未验证 提交 acd4b759 编写于 作者: D dzhwinter 提交者: GitHub

skip_opt_set support list (#14845)

* test=develop

* fix tests. test=develop
上级 0f085f0a
...@@ -484,8 +484,11 @@ def memory_optimize(input_program, ...@@ -484,8 +484,11 @@ def memory_optimize(input_program,
if level != 0 and level != 1: if level != 0 and level != 1:
raise ValueError("only support opt_level 0 or 1.") raise ValueError("only support opt_level 0 or 1.")
if skip_opt_set is not None and not isinstance(skip_opt_set, set): if skip_opt_set is not None:
raise ValueError("only support skip_opt_set as set.") if isinstance(skip_opt_set, set) or isinstance(skip_opt_set, list):
skip_opt_set = set(skip_opt_set)
else:
raise ValueError("only support skip_opt_set as set.")
global PRINT_LOG global PRINT_LOG
PRINT_LOG = print_log PRINT_LOG = print_log
if skip_grads: if skip_grads:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册