Skip to content

Commit 1e9c265

Browse files
author
Beat Buesser
committed
Apply Black formatting
Signed-off-by: Beat Buesser <[email protected]>
1 parent dd8ed3c commit 1e9c265

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

art/defences/preprocessor/pixel_defend.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ def _check_params(self) -> None:
159159

160160
from art.estimators.classification.classifier import ClassifierMixin
161161
from art.estimators.estimator import NeuralNetworkMixin
162+
162163
if hasattr(self, "pixel_cnn") and not (
163164
isinstance(self.pixel_cnn, ClassifierMixin) and isinstance(self.pixel_cnn, NeuralNetworkMixin)
164165
):

art/defences/transformer/poison/neural_cleanse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def __call__(
106106
:param batch_size: The batch size for optimizations in the Neural Cleanse optimization
107107
"""
108108
import keras
109+
109110
if isinstance(transformed_classifier, KerasClassifier) and keras.__version__ == "2.2.4":
110111
transformed_classifier = KerasNeuralCleanse(
111112
model=transformed_classifier.model,

art/estimators/speech_recognition/pytorch_deep_speech.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def predict(
333333
)
334334

335335
# Overwrite results
336-
result_outputs[begin : end, : results[m].shape[1], : results[m].shape[-1]] = results[m].cpu().numpy()
336+
result_outputs[begin:end, : results[m].shape[1], : results[m].shape[-1]] = results[m].cpu().numpy()
337337

338338
# Rearrange to the original order
339339
result_output_sizes_ = result_output_sizes.copy()
@@ -514,7 +514,7 @@ def transform_model_input(
514514
y: Optional[np.ndarray] = None,
515515
compute_gradient: bool = False,
516516
tensor_input: bool = False,
517-
real_lengths: Optional[np.ndarray] = None
517+
real_lengths: Optional[np.ndarray] = None,
518518
) -> Tuple["torch.Tensor", "torch.Tensor", "torch.Tensor", "torch.Tensor", List]:
519519
"""
520520
Transform the user input space into the model input space.

tests/defences/test_neural_cleanse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_keras(self):
5656
Test with a KerasClassifier.
5757
:return:
5858
"""
59-
if keras.__version__ != '2.2.4':
59+
if keras.__version__ != "2.2.4":
6060
self.assertRaises(NotImplementedError)
6161
else:
6262
# Build KerasClassifier

0 commit comments

Comments
 (0)