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

Method getUserCode

tfjs-backend-webgpu/src/clip_vec4_webgpu.ts:42–55  ·  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 var clampedValue = clamp(
48 value, vec4<f32>(uniforms.minVal), vec4<f32>(uniforms.maxVal));
49 clampedValue = select(clampedValue, value, isnanVec4(value));
50 setOutputAtIndex(index, clampedValue);
51 }
52 }
53 `;
54 return userCode;
55 }
56}

Callers

nothing calls this directly

Calls 1

mainFunction · 0.50

Tested by

no test coverage detected