Skip to content

Commit 47801a7

Browse files
f4strbeat-buesser
authored andcommitted
remove huggingface estimator activation hack
Signed-off-by: Farhan Ahmed <[email protected]>
1 parent 4111de6 commit 47801a7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

art/estimators/classification/hugging_face.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,7 @@ def get_activations( # type: ignore
324324
def get_feature(name):
325325
# the hook signature
326326
def hook(model, input, output): # pylint: disable=W0622,W0613
327-
# TODO: this is using the input, rather than the output, to circumvent the fact
328-
# TODO: that flatten is not a layer in pytorch, and the activation defence expects
329-
# TODO: a flattened input. A better option is to refactor the activation defence
330-
# TODO: to not crash if non 2D inputs are provided.
331-
self._features[name] = input
327+
self._features[name] = output
332328

333329
return hook
334330

0 commit comments

Comments
 (0)