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

Method makeTensorFromTensorInfo

tfjs-core/src/engine.ts:848–854  ·  view source on GitHub ↗

* Internal method used by backends. Makes a new tensor that is a wrapper * around an existing data id in TensorInfo. It doesn't create a new data id, * only increments the ref count used in memory tracking.

(tensorInfo: TensorInfo, backend?: KernelBackend)

Source from the content-addressed store, hash-verified

846 * only increments the ref count used in memory tracking.
847 */
848 makeTensorFromTensorInfo(tensorInfo: TensorInfo, backend?: KernelBackend):
849 Tensor {
850 const {dataId, shape, dtype} = tensorInfo;
851 const t = new Tensor(shape, dtype, dataId, this.nextTensorId());
852 this.trackTensor(t, backend);
853 return t;
854 }
855
856 makeVariable(
857 initialValue: Tensor, trainable = true, name?: string,

Callers 11

runKernelFuncMethod · 0.95
makeTensorFromDataIdMethod · 0.95
makeOutputMethod · 0.80
readToGPUMethod · 0.80
createOutputTensorMethod · 0.80
readToGPUMethod · 0.80
packedUnaryOpMethod · 0.80
absMethod · 0.80
makeOutputMethod · 0.80
squareAndAddFunction · 0.80
gradFuncFunction · 0.80

Calls 2

nextTensorIdMethod · 0.95
trackTensorMethod · 0.95

Tested by

no test coverage detected