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

Method getUserCode

tfjs-backend-webgpu/src/conv2d_mm_webgpu.ts:250–269  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

248 }
249
250 getUserCode(): string {
251 const matMulSource = this.isVec4 ?
252 makeMatMulPackedVec4Source(
253 this.elementsPerThread, this.workgroupSize, !this.isChannelsLast,
254 this.tileInner) :
255 makeMatMulPackedSource(
256 this.elementsPerThread, this.workgroupSize, !this.isChannelsLast,
257 this.tileInner, false, null, this.sequentialAccessByThreads);
258 const elementsSize =
259 this.isVec4 ? [this.innerElementSize, 4, 4] : [1, 1, 1];
260 const userCode = `
261 ${
262 conv2dCommonSnippet(
263 this.isChannelsLast, this.fitAOuter, this.fitBOuter, this.fitInner,
264 this.addBias, this.activation, this.hasPreluActivationWeights,
265 elementsSize[0], elementsSize[1], elementsSize[2])}
266 ${matMulSource}
267 `;
268 return userCode;
269 }
270}

Callers

nothing calls this directly

Calls 3

makeMatMulPackedSourceFunction · 0.90
conv2dCommonSnippetFunction · 0.85

Tested by

no test coverage detected