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

Method write

tfjs-backend-cpu/src/backend_cpu.ts:52–71  ·  view source on GitHub ↗
(
      values: backend_util.BackendValues, shape: number[],
      dtype: DataType)

Source from the content-addressed store, hash-verified

50 }
51
52 override write(
53 values: backend_util.BackendValues, shape: number[],
54 dtype: DataType): DataId {
55 if (this.firstUse) {
56 this.firstUse = false;
57 if (env().get('IS_NODE')) {
58 backend_util.warn(
59 '\n============================\n' +
60 'Hi, looks like you are running TensorFlow.js in ' +
61 'Node.js. To speed things up dramatically, install our node ' +
62 'backend, visit https://github.com/tensorflow/tfjs-node for more details. ' +
63 '\n============================');
64 }
65 }
66 const dataId = {id: this.nextDataId()};
67
68 this.data.set(dataId, {values, dtype, refCount: 1});
69
70 return dataId;
71 }
72
73 /**
74 * Create a data bucket in cpu backend.

Callers 1

makeTensorInfoMethod · 0.95

Calls 4

nextDataIdMethod · 0.95
envFunction · 0.90
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected