Skip to content

Commit edd80e2

Browse files
author
Beat Buesser
committed
Update docstring
Signed-off-by: Beat Buesser <[email protected]>
1 parent 5931d57 commit edd80e2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

art/attacks/evasion/shadow_attack.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,16 @@ def __init__(
109109

110110
def generate(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.ndarray:
111111
"""
112-
Generate adversarial samples and return them in an array.
112+
Generate adversarial samples and return them in an array. This requires a lot of memory, therefore it accepts
113+
only a single samples as input, e.g. a batch of size 1.
113114
114-
:param x: An array with the original inputs.
115-
:param y: An array with the target labels.
115+
:param x: An array of a single original input sample.
116+
:param y: An array of a single target label.
116117
:return: An array with the adversarial examples.
117118
"""
119+
if x.shape[0] > 1 or y.shape[0]:
120+
raise ValueError("This attack only accepts a single sample as input.")
121+
118122
y = check_and_transform_label_format(y, self.estimator.nb_classes)
119123

120124
if y is None:

0 commit comments

Comments
 (0)