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

Method getUserCode

tfjs-backend-webgpu/src/onehot_webgpu.ts:39–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 }
38
39 getUserCode(): string {
40 const userCode = `
41 ${main('index')} {
42 if(index < uniforms.size) {
43 let coords = getCoordsFromIndex(index);
44 setOutputAtIndex(index, mix(uniforms.offValue, uniforms.onValue,
45 f32(i32(round(getX(coords.x))) == coords.y)));
46 }
47 }
48 `;
49
50 return userCode;
51 }
52}

Callers

nothing calls this directly

Calls 1

mainFunction · 0.50

Tested by

no test coverage detected