Issue 120035
Summary [MLIR][Tensor] tensor.extractOp adjustment when source is reshaped
Labels mlir
Assignees
Reporter hockyy
    Wondering if there's any adjustment if a source of a extractOp function is reshaped/collapsed/expanded
is the logic of something like  this correct:

```
    // Process indices in the group from right to left.
 // if its dynamic then need to get mixes indices
    // Example:
    // indexing:       2      3       4   5
    // oldMixedSize:   3    | %dim2 | 8 | %dim1
    // extractindices: %ex4 | 1     | 5 | %extract3
    // newIndex = %extract3 + %dim1 * 5 + (8 * %dim1) * 1 + (%dim2 * 8 *
    // %dim1) * %ex4 Create computation using arith here
    // Accumulate indices from right to left
```

for expansion, we need to do modulo and div, for collapse we need to do mul and add
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to