Skip to content

Commit

Permalink
fix an edge case bug of "get_layer"
Browse files Browse the repository at this point in the history
  • Loading branch information
ain-soph committed Jul 13, 2022
1 parent 67fbbcc commit 356dc3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trojanzoo/utils/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def _get_layer(module: nn.Module, x: torch.Tensor,
layer_input = 'record'
elif layer_input == full_name:
layer_input = 'record'
if layer_output.startswith(full_name):
if layer_output == full_name or layer_output.startswith(full_name + '.'):
return x
else:
x = module(x)
Expand Down

0 comments on commit 356dc3d

Please sign in to comment.