From 38593b6a7d7eea7a89ddffd808fe2cc3d59b3e61 Mon Sep 17 00:00:00 2001 From: l00816237 Date: Fri, 8 Dec 2023 10:41:09 +0800 Subject: [PATCH] use the parameter scope instead of api_list when mode is api_list --- .../python/ptdbg_ascend/debugger/precision_debugger.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/debug/accuracy_tools/ptdbg_ascend/src/python/ptdbg_ascend/debugger/precision_debugger.py b/debug/accuracy_tools/ptdbg_ascend/src/python/ptdbg_ascend/debugger/precision_debugger.py index 693fa06ee..4918217ce 100644 --- a/debug/accuracy_tools/ptdbg_ascend/src/python/ptdbg_ascend/debugger/precision_debugger.py +++ b/debug/accuracy_tools/ptdbg_ascend/src/python/ptdbg_ascend/debugger/precision_debugger.py @@ -1,7 +1,7 @@ import os import torch from ..common.utils import Const, check_switch_valid, generate_compare_script, check_is_npu, print_error_log, \ - CompareException + CompareException, print_warn_log from ..dump.dump import DumpUtil, acc_cmp_dump, write_to_disk, get_pkl_file_path from ..dump.utils import set_dump_path, set_dump_switch_print_info, generate_dump_path_str, \ set_dump_switch_config, set_backward_input @@ -48,6 +48,12 @@ class PrecisionDebugger: scope = scope or [] api_list = api_list or [] backward_input = backward_input or [] + # make the api_list model can also use scope parameter temporarily. + if mode == Const.API_LIST: + if len(api_list) > 0: + print_warn_log("The 'api_list' parameter will be deprecated, it would be better to use 'scope'") + else: + api_list = scope set_dump_switch_config(mode=mode, scope=scope, api_list=api_list, filter_switch=filter_switch, dump_mode=input_output_mode, summary_only=summary_only) if mode == 'acl': -- Gitee