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

Method constructor

tfjs-backend-webgpu/src/bincount_webgpu.ts:47–66  ·  view source on GitHub ↗
(
      shape: [number]|[number, number], hasWeights: boolean,
      binaryOutput = false)

Source from the content-addressed store, hash-verified

45 rank: number;
46
47 constructor(
48 shape: [number]|[number, number], hasWeights: boolean,
49 binaryOutput = false) {
50 this.outputShape = shape;
51 this.rank = shape.length;
52 this.dispatchLayout = flatDispatchLayout(this.outputShape);
53 this.dispatch = computeDispatch(
54 this.dispatchLayout, this.outputShape, this.workgroupSize);
55
56 this.binaryOutput = binaryOutput;
57 if (binaryOutput) {
58 this.atomic = false;
59 }
60 this.hasWeights = hasWeights;
61 if (this.hasWeights) {
62 this.variableNames.push('w');
63 }
64 this.shaderKey =
65 `bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`;
66 }
67
68 getUserCode(): string {
69 const userCode = `

Callers

nothing calls this directly

Calls 3

flatDispatchLayoutFunction · 0.90
computeDispatchFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected