MCPcopy Create free account
hub / github.com/tensorflow/tfjs / extractIterations

Function extractIterations

tfjs-core/src/optimizers/optimizer.ts:161–165  ·  view source on GitHub ↗

* Extract the first element of the weight values and set it * as the iterations counter variable of this instance of optimizer. * * @param weightValues * @returns Weight values with the first element consumed and excluded.

(weightValues: NamedTensor[])

Source from the content-addressed store, hash-verified

159 * @returns Weight values with the first element consumed and excluded.
160 */
161 protected async extractIterations(weightValues: NamedTensor[]):
162 Promise<NamedTensor[]> {
163 this.iterations_ = (await weightValues[0].tensor.data())[0];
164 return weightValues.slice(1);
165 }
166}
167
168Object.defineProperty(Optimizer, Symbol.hasInstance, {

Callers

nothing calls this directly

Calls 2

dataMethod · 0.65
sliceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…