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

Method constructor

tfjs-backend-webgl/src/unaryop_gpu.ts:26–41  ·  view source on GitHub ↗
(aShape: number[], opSnippet: string)

Source from the content-addressed store, hash-verified

24 enableShapeUniforms: boolean;
25
26 constructor(aShape: number[], opSnippet: string) {
27 this.outputShape = aShape;
28 this.enableShapeUniforms = useShapeUniforms(this.outputShape.length);
29 this.userCode = `
30 float unaryOperation(float x) {
31 ${opSnippet}
32 }
33
34 void main() {
35 float x = getAAtOutCoords();
36 float y = unaryOperation(x);
37
38 setOutput(y);
39 }
40 `;
41 }
42}
43
44export const CHECK_NAN_SNIPPET = `if (isnan(x)) return x;`;

Callers

nothing calls this directly

Calls 1

useShapeUniformsFunction · 0.90

Tested by

no test coverage detected