Skip to content

Commit

Permalink
[DoubleGrad #4] Bug Fixes to Double Grad Node Generation (PaddlePaddl…
Browse files Browse the repository at this point in the history
…e#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 #4] Supported higher-order GradNode generation

* [DoubleGrad #4] Bug Fixes to Double Grad Node Generation

* Fixed yaml typo

* Fixed yaml typo

* fixed minor issues

* Fixed minor issue
  • Loading branch information
jim19930609 authored Apr 1, 2022
1 parent 4da4265 commit 01724b1
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
########################
### Global Variables ###
########################
ops_to_fill_zero_for_empty_grads = set(["split", "rnn"])
ops_to_fill_zero_for_empty_grads = set(
["split_grad", "rnn_grad", "matmul_double_grad"])

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


def GetIndent(num):
tab = " "
return "".join([tab for i in range(num)])


######################
### Yaml Parsers ###
######################
Expand Down
Loading

0 comments on commit 01724b1

Please sign in to comment.