Skip to content

Commit dd36c47

Browse files
committed
[WIP] New tests
1 parent 16a932c commit dd36c47

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

mlir/unittests/Dialect/Utils/ReshapeOpsUtilsTest.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,22 @@ TEST(ReassociationIndicesForCollapse, DynamicTestFailure) {
155155
{ShapedType::kDynamic, 8, 4, 2, 16, ShapedType::kDynamic},
156156
{ShapedType::kDynamic, 32, ShapedType::kDynamic}),
157157
std::nullopt);
158+
159+
//===----------------------------------------------------------------------===//
160+
// TODO: Reassociation for the following examples can be computed, but isn't
161+
// supported by `getReassociationIndicesForCollapse`.
162+
//===----------------------------------------------------------------------===//
163+
164+
// TODO: Fails because there's no backtracking when some source dimensions
165+
// remain unmatched at either edge.
166+
EXPECT_EQ(getReassociationIndicesForCollapse(
167+
{ShapedType::kDynamic, 10, ShapedType::kDynamic, 10},
168+
{ShapedType::kDynamic, 10}),
169+
std::nullopt);
170+
EXPECT_EQ(getReassociationIndicesForCollapse({1, ShapedType::kDynamic, 2, 2},
171+
{1, ShapedType::kDynamic, 2}),
172+
std::nullopt);
173+
EXPECT_EQ(getReassociationIndicesForCollapse({2, 2, ShapedType::kDynamic, 1},
174+
{2, ShapedType::kDynamic}),
175+
std::nullopt);
158176
}

0 commit comments

Comments
 (0)