Skip to content

Commit

Permalink
remove huggingface estimator activation hack
Browse files Browse the repository at this point in the history
Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
  • Loading branch information
f4str committed Nov 14, 2023
1 parent 123af2c commit 4db7626
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions art/estimators/classification/hugging_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,7 @@ def get_activations( # type: ignore
def get_feature(name):
# the hook signature
def hook(model, input, output): # pylint: disable=W0622,W0613
# TODO: this is using the input, rather than the output, to circumvent the fact
# TODO: that flatten is not a layer in pytorch, and the activation defence expects
# TODO: a flattened input. A better option is to refactor the activation defence
# TODO: to not crash if non 2D inputs are provided.
self._features[name] = input
self._features[name] = output

return hook

Expand Down

0 comments on commit 4db7626

Please sign in to comment.