MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / BackwardPassScopeGuard

Method BackwardPassScopeGuard

oneflow/core/framework/scope_util.cpp:100–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100BackwardPassScopeGuard::BackwardPassScopeGuard() {
101 if (LazyMode::is_enabled()) {
102 const auto& scope = CHECK_JUST(GetCurrentScope());
103 if (scope) {
104 backward_pass_scope_ = CHECK_JUST(FindOrCreateBackwardPassScope(scope));
105 CHECK_JUST(ThreadLocalScopeStackPush(backward_pass_scope_));
106 }
107 }
108}
109
110BackwardPassScopeGuard::BackwardPassScopeGuard(const std::shared_ptr<Scope>& scope) {
111 if (scope && LazyMode::is_enabled()) {

Callers

nothing calls this directly

Calls 4

GetCurrentScopeFunction · 0.85
is_enabledFunction · 0.70

Tested by

no test coverage detected