From ca14dc73afc68ace13fca06ec481477f4764e94b Mon Sep 17 00:00:00 2001 From: fra31 Date: Sat, 30 Jul 2022 22:18:33 +0000 Subject: [PATCH] fix check for tf models --- autoattack/checks.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/autoattack/checks.py b/autoattack/checks.py index de5dd32..964a479 100644 --- a/autoattack/checks.py +++ b/autoattack/checks.py @@ -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))