MCPcopy Index your code
hub / github.com/tensorflow/tfjs / track

Method track

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

* Tracks a Tensor in the current scope to be automatically cleaned up * when the current scope ends, and returns the value. * * @param result The Tensor to track in the current scope.

(result: T)

Source from the content-addressed store, hash-verified

1246 * @param result The Tensor to track in the current scope.
1247 */
1248 private track<T extends Tensor>(result: T): T {
1249 if (this.state.activeScope != null) {
1250 result.scopeId = this.state.activeScope.id;
1251 this.state.activeScope.track.push(result);
1252 }
1253
1254 return result;
1255 }
1256
1257 get registeredVariables(): NamedVariableMap {
1258 return this.state.registeredVariables;

Callers 2

trackTensorMethod · 0.95
endScopeMethod · 0.95

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected