You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I am not sure if @rhit-namburs is still working on this issue so I decided to take a look.
I noticed that softmax.py and tanh.py are already annotated, so I decided to follow their approach. However, this leads to a circular import issue:
sympc.tensor.mpc_tensor.py imports APPROXIMATIONS from sympc.approximations, which includes func = (sigmoid.py, log.py, exponential.py, reciprocal.py, utils.py).
softmax.py and tanh.py import MPCTensor from sympc.tensor to be used for the type annotations. If we do the same for func we go into a loop of imports.
Without restructuring both sympc.approximations folder and MPCTensor class, I think the easiest way to go around this issue is to use TypeVar from typing to define an MPCTensor annotation. I tested and this solution passes the pre-commit tests.
Another possible solution could be to include the approximation functions defined in sympc.approximations folder inside MPCTensor class.
Where?
Currently, the approximations module of SyMPC does not have type annotations.
The following are the files with missing type annotations:
The text was updated successfully, but these errors were encountered: