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

Function TEST

tensorflow/compiler/xla/index_util_test.cc:34–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34TEST(IndexUtilTest, VectorIndexing) {
35 // Vectors are trivially laid out and the linear index should always be the
36 // same as the "multidimensional" index.
37 Shape vector_shape = ShapeUtil::MakeShape(F32, {100});
38 EXPECT_EQ(42,
39 IndexUtil::MultidimensionalIndexToLinearIndex(vector_shape, {42}));
40 std::vector<int64> multi_index =
41 IndexUtil::LinearIndexToMultidimensionalIndex(vector_shape, 42);
42 EXPECT_EQ(1, multi_index.size());
43 EXPECT_EQ(42, multi_index[0]);
44}
45
46TEST(IndexUtilTest, MatrixIndexingRowMajor) {
47 // Set layout to [0, 1]. That is, row major.

Callers

nothing calls this directly

Calls 4

MakeShapeFunction · 0.85
SetMinorToMajorLayoutFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected