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

Method constructor

tfjs-backend-webgpu/src/top_k_webgpu.ts:134–145  ·  view source on GitHub ↗
(shape: number[])

Source from the content-addressed store, hash-verified

132 size = true;
133
134 constructor(shape: number[]) {
135 this.outputShape = shape;
136 this.dispatchLayout = flatDispatchLayout(this.outputShape);
137 this.dispatch = computeDispatch(
138 this.dispatchLayout, this.outputShape, this.workgroupSize);
139 // |n| Size of the original input of TopK
140 // |firstPass| indicates if this is the first time swap is being used which
141 // means no indices input containing the top K is present yet.
142 // |k| Top k elements desired
143 this.uniforms = `inputSize : i32, firstPass : i32, k : i32,`;
144 this.shaderKey = 'merge';
145 }
146
147 getUserCode(): string {
148 const userCode = `

Callers

nothing calls this directly

Calls 2

flatDispatchLayoutFunction · 0.90
computeDispatchFunction · 0.90

Tested by

no test coverage detected