Skip to content

Commit 7748000

Browse files
author
Beat Buesser
committed
Update repr tests and format
Signed-off-by: Beat Buesser <[email protected]>
1 parent 2e568be commit 7748000

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

art/estimators/tensorflow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ def _apply_preprocessing_gradient(self, x, gradients, fit=False):
304304

305305
elif len(self.preprocessing_operations) == 1 or (
306306
len(self.preprocessing_operations) == 2
307-
and isinstance(self.preprocessing_operations[-1], (StandardisationMeanStd, StandardisationMeanStdTensorFlowV2))
307+
and isinstance(
308+
self.preprocessing_operations[-1], (StandardisationMeanStd, StandardisationMeanStdTensorFlowV2)
309+
)
308310
):
309311
# Compatible with non-TensorFlow defences if no chaining.
310312
for preprocess in self.preprocessing_operations[::-1]:

tests/estimators/classification/test_blackbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_repr(self):
9191
self.assertIn("clip_values=[ 0. 255.]", repr_)
9292
self.assertIn("defences=None", repr_)
9393
self.assertIn(
94-
"preprocessing=[StandardisationMeanStd(mean=0, std=1, apply_fit=True, apply_predict=True)]", repr_
94+
"preprocessing=StandardisationMeanStd(mean=0, std=1, apply_fit=True, apply_predict=True)", repr_
9595
)
9696

9797

tests/estimators/classification/test_classifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def test_repr(self):
118118
self.assertIn("clip_values=None", repr_)
119119
self.assertIn("defences=None", repr_)
120120
self.assertIn(
121-
"preprocessing=[StandardisationMeanStd(mean=0, std=1, apply_fit=True, apply_predict=True)]", repr_
121+
"preprocessing=StandardisationMeanStd(mean=0, std=1, apply_fit=True, apply_predict=True)", repr_
122122
)
123123

124124

@@ -147,7 +147,7 @@ def test_repr(self):
147147
self.assertIn("clip_values=[0. 1.]", repr_)
148148
self.assertIn("defences=None", repr_)
149149
self.assertIn(
150-
"preprocessing=[StandardisationMeanStd(mean=0, std=1, apply_fit=True, apply_predict=True)]", repr_
150+
"preprocessing=StandardisationMeanStd(mean=0, std=1, apply_fit=True, apply_predict=True)", repr_
151151
)
152152

153153

tests/estimators/classification/test_detector_classifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_repr(self):
168168
repr_ = repr(self.detector_classifier)
169169
self.assertIn("art.estimators.classification.detector_classifier.DetectorClassifier", repr_)
170170
self.assertIn(
171-
"preprocessing=[StandardisationMeanStd(mean=0, std=1, apply_fit=True, apply_predict=True)]", repr_
171+
"preprocessing=StandardisationMeanStd(mean=0, std=1, apply_fit=True, apply_predict=True)", repr_
172172
)
173173

174174

tests/estimators/classification/test_ensemble.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ def test_repr(self):
255255
self.assertIn("classifier_weights=array([0.5, 0.5])", repr_)
256256
self.assertIn(
257257
f"channel_index={Deprecated}, channels_first=False, clip_values=array([0., 1.], dtype=float32), "
258-
"preprocessing_defences=None, postprocessing_defences=None, preprocessing=[StandardisationMeanStd(mean=0, "
259-
"std=1, apply_fit=True, apply_predict=True)]",
258+
"preprocessing_defences=None, postprocessing_defences=None, preprocessing=StandardisationMeanStd(mean=0, "
259+
"std=1, apply_fit=True, apply_predict=True)",
260260
repr_,
261261
)
262262

0 commit comments

Comments
 (0)