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

Function TEST_F

tensorflow/core/grappler/grappler_item_test.cc:29–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27class GrapplerItemTest : public ::testing::Test {};
28
29TEST_F(GrapplerItemTest, Basic) {
30 TrivialTestGraphInputYielder fake_input(4, 1, 10, false, {{"CPU:0"}});
31 GrapplerItem item;
32 CHECK(fake_input.NextItem(&item));
33
34 EXPECT_TRUE(item.InitOpsFanin().empty());
35
36 std::vector<string> graph_nodes;
37 for (const auto& node : item.graph.node()) {
38 graph_nodes.push_back(node.name());
39 }
40 std::vector<string> main_ops;
41 for (const auto& node : item.MainOpsFanin()) {
42 main_ops.push_back(node->name());
43 }
44 std::sort(graph_nodes.begin(), graph_nodes.end());
45 std::sort(main_ops.begin(), main_ops.end());
46 EXPECT_EQ(main_ops, graph_nodes);
47}
48
49TEST_F(GrapplerItemTest, InferDevices) {
50 using test::function::NDef;

Callers

nothing calls this directly

Calls 15

sortFunction · 0.85
GDefFunction · 0.85
NDefFunction · 0.85
InitOpsFaninMethod · 0.80
MainOpsFaninMethod · 0.80
InferDevicesFromGraphMethod · 0.80
ClearDevicesMethod · 0.80
nameMethod · 0.65
NextItemMethod · 0.45
emptyMethod · 0.45
nodeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected