MCPcopy Create free account
hub / github.com/tensorflow/tfjs / readSync

Method readSync

tfjs-node/src/nodejs_kernel_backend.ts:222–232  ·  view source on GitHub ↗
(dataId: DataId)

Source from the content-addressed store, hash-verified

220 }
221
222 readSync(dataId: DataId): backend_util.BackendValues {
223 if (!this.tensorMap.has(dataId)) {
224 throw new Error(`Tensor ${dataId} was not registered!`);
225 }
226 const info = this.tensorMap.get(dataId);
227 if (info.values != null) {
228 return info.values;
229 } else {
230 return this.binding.tensorDataSync(info.id);
231 }
232 }
233
234 /**
235 * Dispose the memory if the dataId has 0 refCount. Return true if the memory

Callers 1

readMethod · 0.95

Calls 3

hasMethod · 0.80
tensorDataSyncMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected