mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Summary: Fix typo Test Plan: Continuous integration - Expected NoOp since it is just a variable renaming Differential Revision: D44118850 Pull Request resolved: https://github.com/pytorch/pytorch/pull/97054 Approved by: https://github.com/Skylion007
24 lines
549 B
C++
24 lines
549 B
C++
#include <c10/core/AutogradState.h>
|
|
|
|
namespace c10 {
|
|
|
|
namespace {
|
|
// By default, grad mode and multithreading are enabled, inference mode is
|
|
// disabled,
|
|
thread_local AutogradState autograd_state_tls = AutogradState(
|
|
/* grad_mode */ true,
|
|
/* inference_mode */ false,
|
|
/* fw_grad_mode */ true,
|
|
/* multithreading_enabled */ true);
|
|
} // namespace
|
|
|
|
AutogradState& AutogradState::get_tls_state() {
|
|
return autograd_state_tls;
|
|
}
|
|
|
|
void AutogradState::set_tls_state(AutogradState state) {
|
|
autograd_state_tls = state;
|
|
}
|
|
|
|
} // namespace c10
|