MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST_F

Function TEST_F

tensorflow/compiler/xla/layout_util_test.cc:38–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36};
37
38TEST_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
64TEST_F(LayoutUtilTest, CopyLayoutArray) {
65 Shape src = MakeShapeWithLayout(F32, {2, 3}, {0, 1});

Callers

nothing calls this directly

Calls 14

LayoutsInShapesEqualFunction · 0.85
MakeShapeFunction · 0.85
clear_layoutMethod · 0.80
has_layoutMethod · 0.80
mutable_layoutMethod · 0.80
add_tilesMethod · 0.80
add_dimensionsMethod · 0.80
mutable_tuple_shapesMethod · 0.80
EqualClass · 0.70
MakeLayoutFunction · 0.50
HasSubstrFunction · 0.50
okMethod · 0.45

Tested by

no test coverage detected