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

Method makeTensorInfo

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

Source from the content-addressed store, hash-verified

702 }
703
704 makeTensorInfo(
705 shape: number[], dtype: DataType,
706 values?: BackendValues|string[]): TensorInfo {
707 if (dtype === 'string' && values != null && values.length > 0 &&
708 util.isString(values[0])) {
709 values = (values as unknown as string[]).map(d => util.encodeString(d));
710 }
711 const dataId = this.write(values as BackendValues, shape, dtype);
712 return {dataId, shape, dtype};
713 }
714
715 private tensorToBinding(tensor?: TensorInfo): GPUBindingResource {
716 if (!tensor) {

Callers 15

readToGPUMethod · 0.95
runWebGPUProgramMethod · 0.95
reduceFunction · 0.45
unaryKernelFuncFunction · 0.45
binaryKernelFuncFunction · 0.45
concatImplFunction · 0.45
fromPixelsFunction · 0.45
stridedSliceFunction · 0.45
gatherNdFunction · 0.45
topKFunction · 0.45
transposeFunction · 0.45
broadcastArgsFunction · 0.45

Calls 1

writeMethod · 0.95

Tested by

no test coverage detected