-
Notifications
You must be signed in to change notification settings - Fork 802
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix flow.set_grad_mode when directly calling (#10059)
#close Oneflow-Inc/OneCloud#203 (comment) 原先这里和 torch 的实现不同,我们是用 AutoGradMode 这个 C++ 对象的 RAII 来实现更改 grad mode 的,而 torch 是显式地调用 set_grad_mode 来更改的。这就导致了 OneFlow 里面没法全局修改线程里面的 grad mode,只能在装饰器或者上下文语句里面修改。 --------- Co-authored-by: oneflow-ci-bot <ci-bot@oneflow.org> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4e98f8c
commit 37ec204
Showing
3 changed files
with
52 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters