torch-mlir/projects
Xinyu Yang 308c45e61a
[Torch] Fix PrimListUnpackOp::getCanonicalizationPatterns (#3140)
Fix the case PrimListUnpackOp's result num is not equal to PrimList
length.
See the following example:
```python
    def forward(self, x):
        if len(x.shape) == 5:
            b0, t, c0, h0, w0 = x.shape
            b, c, h, w = torch.mul(b0, t), c0, h0, w0
        else:
            b1, c1, h1, w1 = x.shape
            b, c, h, w = b1, c1, h1, w1
        res = torch.reshape(x, [b, c, h, w])
        return res
```
Without this fix, the following error message will occur:
```
/root/torch-mlir/externals/llvm-project/mlir/lib/IR/PatternMatch.cpp:118: virtual void mlir::RewriterBase::replaceOp(mlir::Operation *, mlir::ValueRange): Assertion `op->getNumResults() == newValues.size() && "incorrect # of replacement values"' failed.
```
2024-04-11 19:48:49 +08:00
..
jit_ir_common Additional information in error message (#2783) 2024-01-30 08:28:08 -08:00
ltc Replace c10::optional with std::optional (#3126) 2024-04-09 18:38:33 +00:00
onnx_c_importer build: find Protobuf using config mode search (#2900) 2024-02-12 17:31:41 -06:00
pt1 [Torch] Fix PrimListUnpackOp::getCanonicalizationPatterns (#3140) 2024-04-11 19:48:49 +08:00
CMakeLists.txt [onnx] Add torch-mlir-import-onnx native port as an optional tool/library. (#2694) 2023-12-27 12:13:34 -08:00