Skip to content

Commit 911884b

Browse files
committed
Fix mypy warning on typing
Signed-off-by: Beat Buesser <[email protected]>
1 parent 0aa91b5 commit 911884b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

art/attacks/evasion/adversarial_patch/adversarial_patch_pytorch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,9 @@ def generate( # type: ignore
513513
logger.info("Setting labels to estimator classification predictions.")
514514
y = to_categorical(np.argmax(self.estimator.predict(x=x), axis=1), nb_classes=self.estimator.nb_classes)
515515

516-
y = check_and_transform_label_format(labels=y, nb_classes=self.estimator.nb_classes)
516+
y_array: np.ndarray = y
517+
518+
y = check_and_transform_label_format(labels=y_array, nb_classes=self.estimator.nb_classes)
517519

518520
# check if logits or probabilities
519521
y_pred = self.estimator.predict(x=x[[0]])

0 commit comments

Comments
 (0)