From 38e57d60ac0fe09a42136a8b9d601a3542bcfbf5 Mon Sep 17 00:00:00 2001 From: jim19930609 Date: Fri, 25 Mar 2022 05:51:30 +0000 Subject: [PATCH] Bug fix for intermediate support in Yaml --- .../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 fd750c0d07369e..32aee26e93ccd3 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 @@ -780,7 +780,7 @@ def GenerateForwardDefinition(self, is_inplaced): 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 c43e1752152ba0..0d0c0c7afbbba7 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