提交 e6382643 编写于 作者: Z zhhsplendid

Simplify code, test=develop

上级 f0e558ea
...@@ -65,24 +65,17 @@ def is_unsupported(func): ...@@ -65,24 +65,17 @@ def is_unsupported(func):
Checks whether the func is supported by dygraph to static graph. Checks whether the func is supported by dygraph to static graph.
""" """
func_in_builtin_modules = False
for m in BUILTIN_LIKELY_MODULES: for m in BUILTIN_LIKELY_MODULES:
for v in m.__dict__.values(): for v in m.__dict__.values():
func_in_dict = func == v func_in_dict = func == v
if isinstance(func_in_dict, (list, numpy.ndarray)): if isinstance(func_in_dict, (list, numpy.ndarray)):
func_in_dict = any(func_in_dict) func_in_dict = any(func_in_dict)
if func_in_dict: if func_in_dict:
func_in_builtin_modules = True translator_logger.log(
break 2,
if func_in_builtin_modules: "Whitelist: {} is part of built-in module and does not have to be transformed.".
break format(func))
return True
if func_in_builtin_modules:
translator_logger.log(
2,
"Whitelist: {} is part of built-in module and does not have to be transformed.".
format(func))
return True
if is_paddle_func(func): if is_paddle_func(func):
translator_logger.log( translator_logger.log(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册