Skip to content

Commit

Permalink
Merge branch 'Koukyosyumei:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
b34c0n5 authored Apr 19, 2024
2 parents 110cc53 + 4f4b8da commit 0e8e88d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/aijack/attack/labelleakage/normattack.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def attack(self, dataloader):
"""
epoch_labels = []
epoch_g_norm = []
for i, data in enumerate(dataloader, 0):
for data in dataloader:
inputs, labels = data
inputs = inputs.to(self.device)
labels = labels.to(self.device)
Expand Down
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 0e8e88d

Please sign in to comment.