Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix check for tf models #92

Merged
merged 1 commit into from
Aug 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions autoattack/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ def check_dynamic(model, x, is_tf_model=False, logger=None):
msg = 'the check for dynamic defenses is not currently supported'
else:
msg = None
sys.settrace(tracefunc)
model(x)
sys.settrace(None)
#for k, v in funcs.items():
# print(k, v)
if any([c > 0 for c in funcs.values()]):
msg = 'it seems to be a dynamic defense! The evaluation' + \
' with AutoAttack might be insufficient.' + \
f' See {checks_doc_path} for details.'
sys.settrace(tracefunc)
model(x)
sys.settrace(None)
#for k, v in funcs.items():
# print(k, v)
if any([c > 0 for c in funcs.values()]):
msg = 'it seems to be a dynamic defense! The evaluation' + \
' with AutoAttack might be insufficient.' + \
f' See {checks_doc_path} for details.'
if not msg is None:
if logger is None:
warnings.warn(Warning(msg))
Expand Down