From 07dab9da12231b09271e0f05057458f391d948e4 Mon Sep 17 00:00:00 2001 From: zyfncg Date: Tue, 24 May 2022 22:21:52 +0800 Subject: [PATCH] fix namespace parser in eager_code_gen (#42957) --- .../final_state_generator/codegen_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/eager/auto_code_generator/final_state_generator/codegen_utils.py b/paddle/fluid/eager/auto_code_generator/final_state_generator/codegen_utils.py index 786dd0e3bf..8467a6d7df 100644 --- a/paddle/fluid/eager/auto_code_generator/final_state_generator/codegen_utils.py +++ b/paddle/fluid/eager/auto_code_generator/final_state_generator/codegen_utils.py @@ -447,7 +447,7 @@ class GeneratorBase: def InferNameSpace(self): api_yaml_path = self.api_yaml_path - if "sparse" in api_yaml_path: + if re.search(r"sparse[a-zA-Z0-9_]*\.yaml", api_yaml_path): self.namespace = "sparse::" - elif "strings" in api_yaml_path: + elif re.search(r"strings[a-zA-Z0-9_]*\.yaml", api_yaml_path): self.namespace = "strings::" -- GitLab