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

Method makeTensorInfo

tfjs-backend-webgl/src/backend_webgl.ts:783–799  ·  view source on GitHub ↗
(
      shape: number[], dtype: DataType,
      values?: BackendValues|string[])

Source from the content-addressed store, hash-verified

781 }
782
783 makeTensorInfo(
784 shape: number[], dtype: DataType,
785 values?: BackendValues|string[]): TensorInfo {
786 let dataId;
787 if (dtype === 'string' && values != null && values.length > 0 &&
788 util.isString(values[0])) {
789 const encodedValues =
790 (values as unknown as string[]).map(d => util.encodeString(d));
791
792 dataId = this.write(encodedValues, shape, dtype);
793 } else {
794 dataId = this.write(values as TypedArray, shape, dtype);
795 }
796
797 this.texData.get(dataId).usage = null;
798 return {dataId, shape, dtype};
799 }
800
801 private makeOutput<T extends Tensor>(
802 shape: number[], dtype: DataType, values?: BackendValues): T {

Callers 15

writeTextureMethod · 0.95
makeOutputMethod · 0.95
runWebGLProgramMethod · 0.95
uploadToGPUMethod · 0.95
unaryKernelFuncFunction · 0.45
binaryKernelFuncFunction · 0.45
prepareInputsFunction · 0.45
concatImplFunction · 0.45
fromPixelsFunction · 0.45
stridedSliceFunction · 0.45
raggedGatherFunction · 0.45
bitwiseAndFunction · 0.45

Calls 2

writeMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected