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

Function TEST_P

tensorflow/core/grappler/optimizers/data/slack_test.cc:63–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 : ::testing::TestWithParam<std::tuple<string, int>> {};
62
63TEST_P(ParameterizedSlackTest, BasicTest) {
64 GrapplerItem item;
65 SetupGrapplerItem(&item);
66
67 Slack optimizer;
68 tensorflow::RewriterConfig_CustomGraphOptimizer config;
69 (*config.mutable_parameter_map())["slack_period"].set_s(
70 std::get<0>(GetParam()));
71 TF_ASSERT_OK(optimizer.Init(&config));
72
73 GraphDef output;
74 TF_ASSERT_OK(optimizer.Optimize(nullptr, item, &output));
75 ASSERT_TRUE(graph_utils::ContainsNodeWithOp("PrefetchDataset", output));
76 NodeDef optimized_prefetch_node =
77 output.node(graph_utils::FindGraphNodeWithOp("PrefetchDataset", output));
78 EXPECT_EQ(optimized_prefetch_node.attr().at("slack_period").i(),
79 std::get<1>(GetParam()));
80}
81
82INSTANTIATE_TEST_SUITE_P(DifferentSlackEveryValues, ParameterizedSlackTest,
83 ::testing::Values(std::make_tuple("1", 1),

Callers

nothing calls this directly

Calls 10

SetupGrapplerItemFunction · 0.85
GetParamFunction · 0.85
ContainsNodeWithOpFunction · 0.85
FindGraphNodeWithOpFunction · 0.85
attrMethod · 0.80
InitMethod · 0.45
OptimizeMethod · 0.45
nodeMethod · 0.45
iMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected