(
weightData: io.WeightData, specs: io.WeightsManifestEntry[])
| 342 | } |
| 343 | |
| 344 | function decodeModelAndOptimizerWeights( |
| 345 | weightData: io.WeightData, specs: io.WeightsManifestEntry[]): |
| 346 | {modelWeights: NamedTensorMap, optimizerWeights: NamedTensor[]} { |
| 347 | const name2Tensor = io.decodeWeights(weightData, specs); |
| 348 | const modelWeights: NamedTensorMap = {}; |
| 349 | const optimizerWeights: NamedTensor[] = []; |
| 350 | specs.forEach(spec => { |
| 351 | if (spec.group === 'optimizer') { |
| 352 | optimizerWeights.push({name: spec.name, tensor: name2Tensor[spec.name]}); |
| 353 | } else { |
| 354 | modelWeights[spec.name] = name2Tensor[spec.name]; |
| 355 | } |
| 356 | }); |
| 357 | return {modelWeights, optimizerWeights}; |
| 358 | } |
| 359 | |
| 360 | /** |
| 361 | * Configuration for a Sequential model. |
no test coverage detected
searching dependent graphs…