MCPcopy
hub / github.com/tensorflow/tfjs / startScope

Method startScope

tfjs-core/src/engine.ts:1054–1065  ·  view source on GitHub ↗

* Start a scope. Use this with endScope() to achieve the same functionality * as scope() without the need for a function closure.

(name?: string)

Source from the content-addressed store, hash-verified

1052 * as scope() without the need for a function closure.
1053 */
1054 startScope(name?: string) {
1055 const scopeInfo: ScopeState = {
1056 track: [],
1057 name: 'unnamed scope',
1058 id: this.state.nextScopeId++
1059 };
1060 if (name) {
1061 scopeInfo.name = name;
1062 }
1063 this.state.scopeStack.push(scopeInfo);
1064 this.state.activeScope = scopeInfo;
1065 }
1066
1067 /**
1068 * End a scope. Use this with startScope() to achieve the same functionality

Callers 5

tidyMethod · 0.95
executeTestsFunction · 0.80
engine_test.tsFile · 0.80
f2Function · 0.80
backends_test.tsFile · 0.80

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected