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

Method constructor

tfjs-backend-webgl/src/onehot_gpu.ts:28–40  ·  view source on GitHub ↗
(
      numIndices: number, depth: number, onValue: number, offValue: number)

Source from the content-addressed store, hash-verified

26 seedLoc: WebGLUniformLocation;
27
28 constructor(
29 numIndices: number, depth: number, onValue: number, offValue: number) {
30 this.outputShape = [numIndices, depth];
31
32 this.userCode = `
33 void main() {
34 ivec2 coords = getOutputCoords();
35 int index = round(getIndices(coords.x));
36 setOutput(mix(float(${offValue}), float(${onValue}),
37 float(index == coords.y)));
38 }
39 `;
40 }
41}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected