Skip to content

Commit 4700c02

Browse files
author
Beat Buesser
committed
Fix check for input size
Signed-off-by: Beat Buesser <[email protected]>
1 parent 808dd07 commit 4700c02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

art/attacks/evasion/shadow_attack.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ def generate(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> n
116116
:param y: An array of a single target label.
117117
:return: An array with the adversarial examples.
118118
"""
119-
if x.shape[0] > 1 or y.shape[0]:
119+
print(x.shape)
120+
if x.shape[0] > 1 or y.shape[0] > 1:
120121
raise ValueError("This attack only accepts a single sample as input.")
121122

122123
y = check_and_transform_label_format(y, self.estimator.nb_classes)

0 commit comments

Comments
 (0)