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

Method constructor

tfjs-backend-webgpu/src/tile_webgpu.ts:31–42  ·  view source on GitHub ↗
(aShape: number[], reps: number[])

Source from the content-addressed store, hash-verified

29 rank: number;
30
31 constructor(aShape: number[], reps: number[]) {
32 const outputShape: number[] = new Array(aShape.length);
33 for (let i = 0; i < outputShape.length; i++) {
34 outputShape[i] = aShape[i] * reps[i];
35 }
36 this.outputShape = outputShape;
37 this.dispatchLayout = flatDispatchLayout(this.outputShape);
38 this.dispatch = computeDispatch(
39 this.dispatchLayout, this.outputShape, this.workgroupSize);
40 this.rank = this.outputShape.length;
41 this.shaderKey = 'tile';
42 }
43
44 getUserCode(): string {
45 const sourceCoords = getSourceCoords(this.rank, 'uniforms.');

Callers

nothing calls this directly

Calls 2

flatDispatchLayoutFunction · 0.90
computeDispatchFunction · 0.90

Tested by

no test coverage detected