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
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/aijack/defense/paillier/torch_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

self._paillier_np_array = paillier_array
else:
raise TypeError(f"{type(paillier_array)} is not supported.")
Expand Down