mirror of https://github.com/llvm/torch-mlir
7acabafd84
`AtenStackOp` defines this folder for list operand containing single element: ``` OpFoldResult AtenStackOp::fold(FoldAdaptor adaptor) { auto list = getOperand(0).getDefiningOp<PrimListConstructOp>(); if (!list || !list->hasOneUse() || list.getElements().size() != 1) return nullptr; return list.getElements()[0]; } ``` However, unlike `AtenCatOp`, `AtenStackOp` cannot be folded away for single element list operand because the result from a stack operation contains an additional dimension (of size 1, like expand_shape). This PR removes the `AtenStackOp::fold` method, and adds an e2e test for single element list input case, which fails on current `main` as follows: ``` Unexpected outcome summary: (linalg) ****** Failed tests - 1 tests FAIL - "TensorsStackSingleElementListModule_basic" @ trace item #0 - call to "forward" @ output of call to "forward" ERROR: shape (torch.Size([10, 32])) is not equal to golden shape (torch.Size([10, 1, 32])) ``` Thanks Chris Lalau Keraly for the bug report. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
TorchDialect.cpp | ||
TorchOps.cpp | ||
TorchOpsODSGenerated.cpp | ||
TorchTypes.cpp | ||
UtilsForODSGenerated.cpp | ||
UtilsForODSGenerated.h |