Skip to content

[MLIR][Tensor] tensor.extractOp adjustment when source is reshaped #120035

Open
@hockyy

Description

@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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions