Skip to content

Commit 1ed7567

Browse files
committed
Test corner cases for Hadamard with reduction and contracting inner tensors.
1 parent 1803cd6 commit 1ed7567

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/einsum.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,23 @@ BOOST_AUTO_TEST_CASE(equal_nested_ranks) {
240240
// H;C(op)
241241
BOOST_REQUIRE(check_manual_eval<ArrayToT>(
242242
"ijk;bc,j;d->kji;dcb", {{0, 1}, {0, 1}, {0, 1}}, {{0, 1}}, {2, 3}, {4}));
243+
244+
// H+C;C
245+
BOOST_REQUIRE(
246+
check_manual_eval<ArrayToT>("ijk;mo,kji;no->ik;nm", //
247+
{{0, 3, 6}, {0, 1, 3}, {0, 2, 4}}, //
248+
{{0, 2, 4}, {0, 1, 3}, {0, 3, 6}}, //
249+
{3, 2}, //
250+
{4, 2}));
251+
252+
// H+C;C
253+
BOOST_REQUIRE(
254+
check_manual_eval<ArrayToT>("ijk;mo,ijk;no->ji;nm", //
255+
{{0, 2, 5}, {0, 1, 3}, {0, 3, 4}}, //
256+
{{0, 2, 5}, {0, 1, 3}, {0, 3, 4}}, //
257+
{4, 2}, //
258+
{3, 2}));
259+
243260
}
244261

245262
BOOST_AUTO_TEST_CASE(different_nested_ranks) {

0 commit comments

Comments
 (0)