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

Method write

tfjs-backend-webgpu/src/backend_webgpu.ts:266–276  ·  view source on GitHub ↗
(values: BackendValues, shape: number[], dtype: DataType)

Source from the content-addressed store, hash-verified

264 }
265
266 override write(values: BackendValues, shape: number[], dtype: DataType):
267 DataId {
268 if (dtype === 'complex64' && values != null) {
269 throw new Error(
270 `Cannot write to a complex64 dtype. ` +
271 `Please use tf.complex(real, imag).`);
272 }
273 const dataId = {id: this.nextDataId()};
274 this.tensorMap.set(dataId, {dtype, shape, values, refCount: 1});
275 return dataId;
276 }
277
278 override move(
279 dataId: DataId, values: BackendValues, shape: number[], dtype: DataType,

Callers 1

makeTensorInfoMethod · 0.95

Calls 2

nextDataIdMethod · 0.95
setMethod · 0.45

Tested by

no test coverage detected