Skip to content
  • MaheshRavishankar's avatar
    [mlir][Linalg] Add a utility method to get reassociations maps for reshape. · a6e09391
    MaheshRavishankar authored
    Given the source and destination shapes, if they are static, or if the
    expanded/collapsed dimensions are unit-extent, it is possible to
    compute the reassociation maps that can be used to reshape one type
    into another. Add a utility method to return the reassociation maps
    when possible.
    
    This utility function can be used to fuse a sequence of reshape ops,
    given the type of the source of the producer and the final result
    type. This pattern supercedes a more constrained folding pattern added
    to DropUnitDims pass.
    
    Differential Revision: https://reviews.llvm.org/D101343
    a6e09391
Loading