(
xShape: number[], paddings: Array<[number, number]>,
mode: 'reflect'|'symmetric')
| 31 | size = true; |
| 32 | |
| 33 | constructor( |
| 34 | xShape: number[], paddings: Array<[number, number]>, |
| 35 | mode: 'reflect'|'symmetric') { |
| 36 | this.outputShape = paddings.map( |
| 37 | (p, i) => p[0] /* beforePad */ + xShape[i] + p[1] /* afterPad */); |
| 38 | this.dispatchLayout = flatDispatchLayout(this.outputShape); |
| 39 | this.dispatch = computeDispatch( |
| 40 | this.dispatchLayout, this.outputShape, this.workgroupSize); |
| 41 | |
| 42 | this.xShape = xShape; |
| 43 | paddings.map((_, i) => { |
| 44 | this.uniforms += ` pad${i} : vec2<i32>,`; |
| 45 | }); |
| 46 | this.offset = mode === 'reflect' ? 0 : 1; |
| 47 | this.shaderKey = `mirrorPad_${mode}`; |
| 48 | } |
| 49 | |
| 50 | getUserCode(): string { |
| 51 | const rank = this.xShape.length; |
nothing calls this directly
no test coverage detected