-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for Issue #123 #178
Fix for Issue #123 #178
Conversation
Update torch_wrapper.py
@theperiperi Hi! Thanks for your excellent suggestions! Please check my comments. |
I don't see any comments, where do I check them? |
@@ -21,9 +21,9 @@ class PaillierTensor(object): | |||
"""torch.Tensor-like object for Paillier Encryption""" | |||
|
|||
def __init__(self, paillier_array): | |||
if type(paillier_array) == list: | |||
if isinstance(paillier_array) == list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a typo of isinstance(paillier_array, list)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes,fixed it
self._paillier_np_array = np.array(paillier_array) | ||
elif type(paillier_array) == np.ndarray: | ||
elif isinstance(paillier_array) == np.ndarray: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a typo of isinstance(paillier_array, np.ndarray)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, fixed it
I'm sorry I forgot making my comments public. I think now you can see my comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are almost there!! Please check the document of isinstance. https://docs.python.org/3/library/functions.html#isinstance
Rookie mistake, sorry about that, I think that fixes it |
changed type() to isinstance() for typechecks in src/aijack/defense/paillier/torch_wrapper.py