Skip to content
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

Merged
merged 6 commits into from
Apr 15, 2024
Merged

Fix for Issue #123 #178

merged 6 commits into from
Apr 15, 2024

Conversation

theperiperi
Copy link
Contributor

changed type() to isinstance() for typechecks in src/aijack/defense/paillier/torch_wrapper.py

@theperiperi theperiperi changed the title Fixed Issue #123 Fix for Issue #123 Apr 14, 2024
@Koukyosyumei
Copy link
Owner

@theperiperi Hi! Thanks for your excellent suggestions! Please check my comments.

@theperiperi
Copy link
Contributor Author

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:
Copy link
Owner

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)?

Copy link
Contributor Author

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:
Copy link
Owner

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)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, fixed it

@Koukyosyumei
Copy link
Owner

Koukyosyumei commented Apr 15, 2024

I'm sorry I forgot making my comments public. I think now you can see my comments.

Copy link
Owner

@Koukyosyumei Koukyosyumei left a 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

@theperiperi
Copy link
Contributor Author

Rookie mistake, sorry about that, I think that fixes it

@Koukyosyumei Koukyosyumei merged commit 4f4b8da into Koukyosyumei:main Apr 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants