Skip to content

Commit 3252ef1

Browse files
Irina NicolaeIrina Nicolae
authored andcommitted
Remove batch size in TextFGSM
1 parent 202cb2e commit 3252ef1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

art/attacks/configurable_text_attack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __call__(self, classifier, x, y):
2121
batch_x = np.expand_dims(x, axis=0)
2222
x_embed = classifier.to_embedding(batch_x)
2323
x_embed_adv = x_embed + self.eps * classifier.loss_gradient(batch_x, np.expand_dims(y, axis=0))[0]
24-
return x_embed_adv
24+
return x_embed_adv[0]
2525

2626

2727
class TemporalHeadScore:

0 commit comments

Comments
 (0)