@@ -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