Investigate and refactor mul_and_div in FPT
Describe the issue
Now that we support negative value of shares below code segment in mul_and_div in precision.py is not useful because it is essentially not doing anything just breaking down the share values based on whether it's positive or negative into pos_self and neg_self and then adding them element-wise to get back the original tensor with no changes.
But if we remove this then linalg functions(like DASH, crypto_lr etc) break by giving type mismatch error in division.
# sgn_self is 1 when new_self is positive else it's 0
# The comparison is different if new_self is a torch tensor or an AST
sgn_self = (new_self > 0).type(self.torch_dtype)
pos_self = new_self * sgn_self
neg_self = new_self * (sgn_self - 1)
new_self = neg_self + pos_self
Expected solution
This can be removed and refactored for a performance boost.
This issue has been marked stale because it has been open 30 days with no activity. Leave a comment or remove the stale label to unmark it. Otherwise, this will be closed in 7 days.
This issue has been marked stale because it has been open 30 days with no activity. Leave a comment or remove the stale label to unmark it. Otherwise, this will be closed in 7 days.