| 36 | }; |
| 37 | |
| 38 | TEST_F(LayoutUtilTest, TupleLayoutComparison) { |
| 39 | Shape shape = |
| 40 | ShapeUtil::MakeTupleShape({MakeShapeWithLayout(F32, {2, 3}, {0, 1})}); |
| 41 | Shape other_shape = |
| 42 | ShapeUtil::MakeTupleShape({MakeShapeWithLayout(F32, {2, 2}, {0, 1})}); |
| 43 | |
| 44 | Shape tuple0 = ShapeUtil::MakeTupleShape({}); |
| 45 | Shape tuple1 = ShapeUtil::MakeTupleShape({shape}); |
| 46 | Shape tuple2 = ShapeUtil::MakeTupleShape({shape, shape}); |
| 47 | |
| 48 | EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(tuple0, tuple0)); |
| 49 | EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple0, tuple1)); |
| 50 | EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple0, tuple2)); |
| 51 | EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple1, tuple0)); |
| 52 | EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple2, tuple0)); |
| 53 | |
| 54 | EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(tuple1, tuple1)); |
| 55 | EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple1, tuple2)); |
| 56 | EXPECT_FALSE(LayoutUtil::LayoutsInShapesEqual(tuple2, tuple1)); |
| 57 | |
| 58 | Shape other_tuple2 = ShapeUtil::MakeTupleShape({shape, other_shape}); |
| 59 | EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(tuple2, tuple2)); |
| 60 | EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(tuple2, other_tuple2)); |
| 61 | EXPECT_TRUE(LayoutUtil::LayoutsInShapesEqual(other_tuple2, tuple2)); |
| 62 | } |
| 63 | |
| 64 | TEST_F(LayoutUtilTest, CopyLayoutArray) { |
| 65 | Shape src = MakeShapeWithLayout(F32, {2, 3}, {0, 1}); |
nothing calls this directly
no test coverage detected