diff --git a/src/aijack/defense/paillier/torch_wrapper.py b/src/aijack/defense/paillier/torch_wrapper.py index 8dc1e585..5a2bdea9 100644 --- a/src/aijack/defense/paillier/torch_wrapper.py +++ b/src/aijack/defense/paillier/torch_wrapper.py @@ -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.")