(
flattenXShape: number[], sliceDim: number, indicesRank: number,
updatesRank: number, strides: number[], shape: number[],
outputDtype: DataType, sumDupeIndices = true)
| 37 | type: DataType; |
| 38 | |
| 39 | constructor( |
| 40 | flattenXShape: number[], sliceDim: number, indicesRank: number, |
| 41 | updatesRank: number, strides: number[], shape: number[], |
| 42 | outputDtype: DataType, sumDupeIndices = true) { |
| 43 | this.outputShape = shape; |
| 44 | this.type = outputDtype; |
| 45 | this.sumDupeIndices = sumDupeIndices; |
| 46 | this.dispatchLayout = flatDispatchLayout(flattenXShape); |
| 47 | // Dispatching based on |updates| shape instead of output shape. |
| 48 | this.dispatch = |
| 49 | computeDispatch(this.dispatchLayout, flattenXShape, this.workgroupSize); |
| 50 | this.sliceDimGreaterThanOne = sliceDim > 1; |
| 51 | this.shaderKey = |
| 52 | `scatter_${indicesRank}_${updatesRank}_${this.sliceDimGreaterThanOne}_${ |
| 53 | outputDtype}_${sumDupeIndices}_${strides.length}`; |
| 54 | const stridesType = getCoordsDataType(strides.length); |
| 55 | this.uniforms = |
| 56 | `sliceDim : i32, strides: ${stridesType}, updatesSize: i32,`; |
| 57 | this.updatesRank = updatesRank; |
| 58 | this.indicesRank = indicesRank; |
| 59 | } |
| 60 | |
| 61 | getUserCode(): string { |
| 62 | let indicesString = ''; |
nothing calls this directly
no test coverage detected