diff --git a/python/paddle/fluid/dygraph/dygraph_to_static/convert_call_func.py b/python/paddle/fluid/dygraph/dygraph_to_static/convert_call_func.py index a62b815975ead102e40a465b7323a4b5938667d4..57c36e80fda88314926319a11200987428b387df 100644 --- a/python/paddle/fluid/dygraph/dygraph_to_static/convert_call_func.py +++ b/python/paddle/fluid/dygraph/dygraph_to_static/convert_call_func.py @@ -65,24 +65,17 @@ def is_unsupported(func): Checks whether the func is supported by dygraph to static graph. """ - func_in_builtin_modules = False for m in BUILTIN_LIKELY_MODULES: for v in m.__dict__.values(): func_in_dict = func == v if isinstance(func_in_dict, (list, numpy.ndarray)): func_in_dict = any(func_in_dict) if func_in_dict: - func_in_builtin_modules = True - break - if func_in_builtin_modules: - break - - 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 + 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): translator_logger.log(