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

Method constructor

tfjs-backend-webgpu/src/transpose_webgpu.ts:32–45  ·  view source on GitHub ↗
(aShape: number[], newDim: number[])

Source from the content-addressed store, hash-verified

30 size = true;
31
32 constructor(aShape: number[], newDim: number[]) {
33 const outputShape: number[] = new Array(aShape.length);
34 for (let i = 0; i < outputShape.length; i++) {
35 outputShape[i] = aShape[newDim[i]];
36 }
37 this.outputShape = outputShape;
38 this.dispatchLayout = flatDispatchLayout(this.outputShape);
39 this.dispatch = computeDispatch(
40 this.dispatchLayout, this.outputShape, this.workgroupSize,
41 [this.workPerThread, 1, 1]);
42
43 this.newDim = newDim;
44 this.shaderKey = `transpose_${newDim}`;
45 }
46
47 getUserCode(): string {
48 const dtype = getCoordsDataType(this.outputShape.length);

Callers

nothing calls this directly

Calls 2

flatDispatchLayoutFunction · 0.90
computeDispatchFunction · 0.90

Tested by

no test coverage detected