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

Method constructor

tfjs-backend-webgl/src/binaryop_gpu.ts:34–48  ·  view source on GitHub ↗
(op: string, aShape: number[], bShape: number[])

Source from the content-addressed store, hash-verified

32 enableShapeUniforms: boolean;
33
34 constructor(op: string, aShape: number[], bShape: number[]) {
35 this.outputShape = backend_util.assertAndGetBroadcastShape(aShape, bShape);
36 this.enableShapeUniforms = useShapeUniforms(this.outputShape.length);
37 this.userCode = `
38 float binaryOperation(float a, float b) {
39 ${op}
40 }
41
42 void main() {
43 float a = getAAtOutCoords();
44 float b = getBAtOutCoords();
45 setOutput(binaryOperation(a, b));
46 }
47 `;
48 }
49}

Callers

nothing calls this directly

Calls 1

useShapeUniformsFunction · 0.90

Tested by

no test coverage detected