mirror of https://github.com/llvm/torch-mlir
d310bb12bd
Currently, the op `torch.tensor_static_info_cast` will not get canonicalized away if the result type has any shape or dtype information. This is because `isValidSubtype` only returns true when the tensor types being compared are exactly the same or the supertype has no shape and dtype information. Being unable to canonicalize away the `torch.tensor_static_info_cast` gets in the way of further optimizations, such as shape propagation. This commit improves `isValidSubtype` by adding logic that compares the shapes and dtypes of the two tensor types to determine of one type is indeed a valid subtype of the other. Fixes https://github.com/llvm/torch-mlir/issues/1926 |
||
---|---|---|
.. | ||
Torch | ||
TorchConversion |