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

Function TEST

tensorflow/core/grappler/optimizers/data/graph_utils_test.cc:28–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace {
27
28TEST(GraphUtilsTest, GetFirstElementIndexWithPredicate) {
29 std::vector<int> vec({1, 2, 3, 4, 5, 6});
30 auto result = GetFirstElementIndexWithPredicate(
31 [](int elem) { return elem % 3 == 0; }, vec);
32
33 EXPECT_EQ(result, 2);
34
35 result = GetFirstElementIndexWithPredicate(
36 [](int elem) { return elem % 7 == 0; }, vec);
37 EXPECT_EQ(result, -1);
38}
39
40TEST(GraphUtilsTest, AddScalarConstNodeBool) {
41 GraphDef graph_def;

Callers

nothing calls this directly

Calls 15

AddScalarPlaceholderFunction · 0.85
ContainsNodeWithOpFunction · 0.85
FindGraphNodeWithNameFunction · 0.85
FindGraphNodeWithOpFunction · 0.85
FindAllGraphNodesWithOpFunction · 0.85
EnsureNodeNamesUniqueFunction · 0.85
GetFetchNodeFunction · 0.85

Tested by

no test coverage detected