From 595338c67a3b1871118741c37c0dafe1276e98d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AD=E4=B8=AA=E9=AA=A8=E5=A4=B4?= <46243324+zrr1999@users.noreply.github.com> Date: Mon, 5 Dec 2022 17:04:20 +0800 Subject: [PATCH] fix bug in paddle/phi/api/yaml/generator (#48659) * fix bug * fix bugs in api_gen tools --- paddle/fluid/operators/generator/cross_validate.py | 4 ++-- paddle/phi/api/yaml/generator/api_gen.py | 2 +- paddle/phi/api/yaml/generator/backward_api_gen.py | 2 +- paddle/phi/api/yaml/generator/intermediate_api_gen.py | 2 +- paddle/phi/api/yaml/generator/wrapped_infermeta_gen.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/operators/generator/cross_validate.py b/paddle/fluid/operators/generator/cross_validate.py index 7c5014994c..82d21f47c6 100644 --- a/paddle/fluid/operators/generator/cross_validate.py +++ b/paddle/fluid/operators/generator/cross_validate.py @@ -40,14 +40,14 @@ if __name__ == "__main__": '--forward_yaml_paths', type=str, nargs='+', - default=str(current_dir / "op .parsed.yaml"), + default=[str(current_dir / "op .parsed.yaml")], help="forward op yaml file.", ) parser.add_argument( '--backward_yaml_paths', type=str, nargs='+', - default=str(current_dir / "backward_op .parsed.yaml"), + default=[str(current_dir / "backward_op .parsed.yaml")], help="backward op yaml file.", ) diff --git a/paddle/phi/api/yaml/generator/api_gen.py b/paddle/phi/api/yaml/generator/api_gen.py index c9ebfd7fea..63e6d6cb50 100644 --- a/paddle/phi/api/yaml/generator/api_gen.py +++ b/paddle/phi/api/yaml/generator/api_gen.py @@ -409,7 +409,7 @@ def main(): '--api_yaml_path', help='path to api yaml file', nargs='+', - default='paddle/phi/api/yaml/ops.yaml', + default=['paddle/phi/api/yaml/ops.yaml'], ) parser.add_argument( diff --git a/paddle/phi/api/yaml/generator/backward_api_gen.py b/paddle/phi/api/yaml/generator/backward_api_gen.py index 75914ac400..4d10f8b56b 100644 --- a/paddle/phi/api/yaml/generator/backward_api_gen.py +++ b/paddle/phi/api/yaml/generator/backward_api_gen.py @@ -351,7 +351,7 @@ def main(): '--backward_yaml_path', help='path to backward yaml file', nargs='+', - default='paddle/phi/api/yaml/backward.yaml', + default=['paddle/phi/api/yaml/backward.yaml'], ) parser.add_argument( '--backward_header_path', diff --git a/paddle/phi/api/yaml/generator/intermediate_api_gen.py b/paddle/phi/api/yaml/generator/intermediate_api_gen.py index 0c53a578b3..9cab819aa4 100644 --- a/paddle/phi/api/yaml/generator/intermediate_api_gen.py +++ b/paddle/phi/api/yaml/generator/intermediate_api_gen.py @@ -147,7 +147,7 @@ def main(): '--api_yaml_path', nargs='+', help='path to api yaml file', - default='paddle/phi/api/yaml/ops.yaml', + default=['paddle/phi/api/yaml/ops.yaml'], ) parser.add_argument( diff --git a/paddle/phi/api/yaml/generator/wrapped_infermeta_gen.py b/paddle/phi/api/yaml/generator/wrapped_infermeta_gen.py index fdbb9caa33..d9dc4dfc1c 100644 --- a/paddle/phi/api/yaml/generator/wrapped_infermeta_gen.py +++ b/paddle/phi/api/yaml/generator/wrapped_infermeta_gen.py @@ -181,7 +181,7 @@ def main(): '--api_yaml_path', help='path to api yaml file', nargs='+', - default='paddle/phi/api/yaml/ops.yaml', + default=['paddle/phi/api/yaml/ops.yaml'], ) parser.add_argument( '--wrapped_infermeta_header_path', -- GitLab