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

Function decodeModelAndOptimizerWeights

tfjs-layers/src/models.ts:344–358  ·  view source on GitHub ↗
(
    weightData: io.WeightData, specs: io.WeightsManifestEntry[])

Source from the content-addressed store, hash-verified

342}
343
344function 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.

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…