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

Method getUserCode

tfjs-backend-webgpu/src/clip_webgpu.ts:42–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40 }
41
42 getUserCode(): string {
43 const userCode = `
44 ${main('index')} {
45 if(index < uniforms.size) {
46 let value = getAByOutputIndex(index);
47 if (isnan(value)) {
48 setOutputAtIndex(index, value);
49 return;
50 }
51 setOutputAtIndex(index, clamp(value, uniforms.minVal, uniforms.maxVal));
52 }
53 }
54 `;
55 return userCode;
56 }
57}

Callers

nothing calls this directly

Calls 1

mainFunction · 0.50

Tested by

no test coverage detected