[Eager] Make sure test case work under eager mode #1106
Merged
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.
FLAGS_retain_grad_for_all_tensor 仅对新动态图生效,原本默认值为 True,即保留所有 tensor 的梯度信息。后因模型中保留所有 tensor 的梯度将会大量占用显存,于是将其默认值改成 False PR43142,因此相关单测在切换到新动态时,需要手动设置为 True。
ps: 目前 PR-CE-Framework 流水线已经切换到 新动态图模式。