From 3f4099eeb842039743b9715dcef05a762bc79d8b Mon Sep 17 00:00:00 2001 From: Zhanlue Yang Date: Mon, 28 Mar 2022 09:50:12 +0800 Subject: [PATCH] Bug fix for intermediate support in Yaml (#40935) --- .../auto_code_generator/final_state_generator/eager_gen.py | 2 +- python/paddle/utils/code_gen/sparse_api.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/eager/auto_code_generator/final_state_generator/eager_gen.py b/paddle/fluid/eager/auto_code_generator/final_state_generator/eager_gen.py index f23582bdd1..fa0a295256 100644 --- a/paddle/fluid/eager/auto_code_generator/final_state_generator/eager_gen.py +++ b/paddle/fluid/eager/auto_code_generator/final_state_generator/eager_gen.py @@ -860,7 +860,7 @@ class DygraphSingleFunctionGenerator(FunctionGeneratorBase): for name, (rtype, pos) in forward_outputs_position_map.items(): if name in intermediate_outputs: continue - if num_outputs == 1: + if num_outputs == 1 and len(intermediate_outputs) == 0: returns_list[0] = f"api_result" else: # Tuple api_result diff --git a/python/paddle/utils/code_gen/sparse_api.yaml b/python/paddle/utils/code_gen/sparse_api.yaml index 770aaeae88..293fdc1528 100644 --- a/python/paddle/utils/code_gen/sparse_api.yaml +++ b/python/paddle/utils/code_gen/sparse_api.yaml @@ -4,7 +4,7 @@ kernel : func : sparse_conv3d layout : x - # intermediate : rulebook + intermediate : rulebook backward : conv3d_grad - api : to_dense -- GitLab