MCPcopy
hub / github.com/tensorflow/tfjs / setWeights

Method setWeights

tfjs-layers/src/models.ts:679–684  ·  view source on GitHub ↗

* Sets the weights of the model. * * @param weights Should be a list of Tensors with shapes and types matching * the output of `model.getWeights()`.

(weights: Tensor[])

Source from the content-addressed store, hash-verified

677 * the output of `model.getWeights()`.
678 */
679 override setWeights(weights: Tensor[]): void {
680 if (this.model == null) {
681 this.build();
682 }
683 this.model.setWeights(weights);
684 }
685
686 /**
687 * Returns the loss value & metrics values for the model in test mode.

Callers 2

models_test.tsFile · 0.45

Calls 1

buildMethod · 0.95

Tested by

no test coverage detected