(aShape: GatherShape, outputShape: GatherShape)
| 27 | rank: number; |
| 28 | |
| 29 | constructor(aShape: GatherShape, outputShape: GatherShape) { |
| 30 | this.outputShape = outputShape; |
| 31 | this.rank = outputShape.length; |
| 32 | const dtype = getCoordsDataType(this.rank); |
| 33 | const sourceCoords = getSourceCoords(aShape, 2); |
| 34 | |
| 35 | this.userCode = ` |
| 36 | void main() { |
| 37 | ${dtype} resRC = getOutputCoords(); |
| 38 | int index = int(getIndices(resRC.x, resRC.z)); |
| 39 | float inBounds = (index >= 0) && (index < ${aShape[2]}) ? 1.0 : 0.0; |
| 40 | setOutput(inBounds * getA(${sourceCoords})); |
| 41 | } |
| 42 | `; |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | // The input and output are always flattened into rank 4 tensors. |
nothing calls this directly
no test coverage detected