Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR types
Bug fixes
PR changes
APIs
Describe
修复当传入的初始梯度是反向图中的非叶子节点时候,backward API 失败的bug。
问题描述:
若在反向图中指定了非叶子节点(图中Pow(x,2)@Grad )的初始梯度值,则该Node不能直接进行反向计算,需要待其上游节点(图中 Pow(y,3)@Grad)执行完成后再进行计算。同时,该上游节点产生的梯度值需要和指定的初始值进行累加后,作为该节点(图中Pow(x,2)@Grad )的输入。
修复方式: