Skip to content

Commit 4b36a48

Browse files
author
Beat Buesser
committed
Update tests for ShadowAttack
Signed-off-by: Beat Buesser <[email protected]>
1 parent 4700c02 commit 4b36a48

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

art/attacks/evasion/shadow_attack.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ 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-
print(x.shape)
120119
if x.shape[0] > 1 or y.shape[0] > 1:
121120
raise ValueError("This attack only accepts a single sample as input.")
122121

tests/attacks/evasion/test_shadow_attack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_generate(fix_get_mnist_subset, get_image_classifier_list_for_attack):
5959

6060
x_train_mnist_adv = attack.generate(x=x_train_mnist[0:1], y=y_train_mnist[0:1])
6161

62-
assert np.max(np.abs(x_train_mnist_adv - x_train_mnist[0:1])) == pytest.approx(0.34966960549354553, 0.06)
62+
assert np.max(np.abs(x_train_mnist_adv - x_train_mnist[0:1])) == pytest.approx(0.34966960549354553, abs=0.06)
6363

6464

6565
@pytest.mark.skipMlFramework("keras", "scikitlearn")

0 commit comments

Comments
 (0)