Skip to content

Commit 01724b1

Browse files
authored
[DoubleGrad PaddlePaddle#4] Bug Fixes to Double Grad Node Generation (PaddlePaddle#41121)
* [Refactor] refactored eager_gen.py PR #2 * [DoubleGrad PR #1] Decoupled code generation logics for Dygraph ForwardFunctions and GradNodes * Fixed minor issue * Adjusted logics of GenerateNodeCreationCodes and GenerateForwardDefinition * Fixed issues * Supported higher-order grad node generation * [DoubleGrad PR PaddlePaddle#4] Supported higher-order GradNode generation * [DoubleGrad PaddlePaddle#4] Bug Fixes to Double Grad Node Generation * Fixed yaml typo * Fixed yaml typo * fixed minor issues * Fixed minor issue
1 parent 4da4265 commit 01724b1

5 files changed

Lines changed: 218 additions & 156 deletions

File tree

paddle/fluid/eager/auto_code_generator/final_state_generator/codegen_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
########################
2222
### Global Variables ###
2323
########################
24-
ops_to_fill_zero_for_empty_grads = set(["split", "rnn"])
24+
ops_to_fill_zero_for_empty_grads = set(
25+
["split_grad", "rnn_grad", "matmul_double_grad"])
2526

2627
# For API dispatch used at python-level
2728
# { op_name : [arg_name, ...] }
@@ -176,6 +177,11 @@ def TransformGradVarNameForDoubleGradGeneration(string):
176177
return string
177178

178179

180+
def GetIndent(num):
181+
tab = " "
182+
return "".join([tab for i in range(num)])
183+
184+
179185
######################
180186
### Yaml Parsers ###
181187
######################

0 commit comments

Comments
 (0)