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

Method writeMany

tfjs-converter/src/executor/tensor_array.ts:164–174  ·  view source on GitHub ↗

* Helper method to write multiple tensors to the specified indices.

(indices: number[], tensors: Tensor[])

Source from the content-addressed store, hash-verified

162 * Helper method to write multiple tensors to the specified indices.
163 */
164 writeMany(indices: number[], tensors: Tensor[]) {
165 if (indices.length !== tensors.length) {
166 throw new Error(
167 `TensorArray ${this.name}: could not write multiple tensors,` +
168 `because the index size: ${
169 indices.length} is not the same as tensors size: ${
170 tensors.length}.`);
171 }
172
173 indices.forEach((i, index) => this.write(i, tensors[index]));
174 }
175
176 /**
177 * Return selected values in the TensorArray as a packed Tensor. All of

Callers 4

scatterMethod · 0.95
splitMethod · 0.95

Calls 1

writeMethod · 0.95

Tested by

no test coverage detected