* 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[])
| 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 | |
| 168 | Object.defineProperty(Optimizer, Symbol.hasInstance, { |