torch-mlir/lib
Vinayak Dev 67732883fa
[torch] Fix unsqueezed output shape in canonicalization of AtenUnflattenIntOp (#3730)
Fixes https://github.com/iree-org/iree/issues/18562.

During canonicalization pass on `AtenUnflattenIntOp`, if the second dim
was statically equal to one, we would create an `AtenAddIntOp` to add
one to the dimension obtained from `op.getDim()`. This, when passed into
`Torch::unsqueezeTensor()`, would make it get interpreted as
non-constant, which would lead to MLIR failing an assertion when
`UnsqueezeOp` would later get lowered into `ExpandShapeOp`, as the
output of the `UnsqueezeOp` would consist of only dynamic dims.

This patch fixes this behavior, by extracting the integer value from the
dim if it was constant, and then emitting a `ConstantIntOp` from
(dim+1). This creates an output with static shape.
2024-09-24 11:45:18 -05:00
..
CAPI [ONNX] add int16 quantization support (#3446) 2024-06-12 10:37:22 +05:30
Conversion [onnx] Relax constraints on input tensors in `onnx.STFT` conversion to torch dialect (#3676) 2024-09-23 12:09:29 +05:30
Dialect [torch] Fix unsqueezed output shape in canonicalization of AtenUnflattenIntOp (#3730) 2024-09-24 11:45:18 -05:00
RefBackend Add missing dependency to TorchMLIRRefBackend target (#3107) 2024-08-14 23:41:51 +08:00
CMakeLists.txt Link necessary op interface implementations (#3364) 2024-06-03 19:43:28 -05:00
InitAll.cpp [Stablehlo] legalize deprecated ops to stablehlo ops (#3543) 2024-07-17 00:05:11 +08:00