* 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)
| 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; |
no test coverage detected