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

Method shouldExecuteOnCPU

tfjs-backend-webgpu/src/backend_webgpu.ts:1029–1036  ·  view source on GitHub ↗
(
      inputs: TensorInfo[],
      sizeThreshold = CPU_HANDOFF_SIZE_THRESHOLD)

Source from the content-addressed store, hash-verified

1027 }
1028
1029 shouldExecuteOnCPU(
1030 inputs: TensorInfo[],
1031 sizeThreshold = CPU_HANDOFF_SIZE_THRESHOLD): boolean {
1032 return env().getBool('WEBGPU_CPU_FORWARD') &&
1033 inputs.every(
1034 input => this.tensorMap.get(input.dataId).resource == null &&
1035 util.sizeFromShape(input.shape) < sizeThreshold);
1036 }
1037
1038 override numDataIds() {
1039 return this.tensorMap.numDataIds() - this.tensorDataPendingDisposal.length;

Callers 14

reduceFunction · 0.45
unaryKernelFuncFunction · 0.45
binaryKernelFuncFunction · 0.45
concatImplFunction · 0.45
stridedSliceFunction · 0.45
gatherNdFunction · 0.45
topKFunction · 0.45
transposeFunction · 0.45
broadcastArgsFunction · 0.45
gatherV2Function · 0.45
negFunction · 0.45
tileFunction · 0.45

Calls 3

envFunction · 0.90
getBoolMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected