(xShape: number[], paddings: Array<[number, number]>)
| 62 | size = true; |
| 63 | |
| 64 | constructor(xShape: number[], paddings: Array<[number, number]>) { |
| 65 | this.outputShape = paddings.map( |
| 66 | (p, i) => p[0] /* beforePad */ + xShape[i] + p[1] /* afterPad */); |
| 67 | this.dispatchLayout = flatDispatchLayout(this.outputShape); |
| 68 | this.dispatch = computeDispatch( |
| 69 | this.dispatchLayout, this.outputShape, this.workgroupSize); |
| 70 | paddings.map((_, i) => { |
| 71 | this.uniforms += ` pad${i} : vec2<i32>,`; |
| 72 | }); |
| 73 | this.xShape = xShape; |
| 74 | this.shaderKey = 'pad'; |
| 75 | } |
| 76 | |
| 77 | getUserCode(): string { |
| 78 | const userCode = ` |
nothing calls this directly
no test coverage detected