(aShape: number[], newDim: number[])
| 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); |
nothing calls this directly
no test coverage detected