()
| 39 | } |
| 40 | |
| 41 | getUserCode(): string { |
| 42 | const sourceCoords = getSourceCoords(this.aShape); |
| 43 | const userCode = ` |
| 44 | ${main('index')} { |
| 45 | if (index < uniforms.size) { |
| 46 | let resRC = getCoordsFromIndex(index); |
| 47 | let indexZ = i32(getIndices(resRC.x, resRC.z)); |
| 48 | let inBounds = select(0.0, 1.0, indexZ >= 0 && indexZ < uniforms.aShape[2]); |
| 49 | setOutputAtIndex(index, inBounds * getA(${sourceCoords})); |
| 50 | } |
| 51 | } |
| 52 | `; |
| 53 | return userCode; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // The input and output are always flattened into rank 4 tensors. |
nothing calls this directly
no test coverage detected