Skip to content

Commit

Permalink
Fix for Issue #123 (#178)
Browse files Browse the repository at this point in the history
* Update torch_wrapper.py

* Update torch_wrapper.py

* Update torch_wrapper.py

* remove redundant comparisons

---------

Co-authored-by: Hideaki Takahashi <koukyosyumei@hotmail.com>
  • Loading branch information
theperiperi and Koukyosyumei authored Apr 15, 2024
1 parent 54886fa commit 4f4b8da
Showing 1 changed file with 2 additions and 2 deletions.
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):
self._paillier_np_array = np.array(paillier_array)
elif type(paillier_array) == np.ndarray:
elif isinstance(paillier_array, np.ndarray):
self._paillier_np_array = paillier_array
else:
raise TypeError(f"{type(paillier_array)} is not supported.")
Expand Down

0 comments on commit 4f4b8da

Please sign in to comment.