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

Function TEST

tensorflow/core/grappler/optimizers/data/make_sloppy_test.cc:32–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace {
31
32TEST(MakeSloppy, ParallelInterleave) {
33 using test::function::NDef;
34 GrapplerItem item;
35 item.graph = test::function::GDef(
36 {NDef("start", "Const", {}, {{"value", 0}, {"dtype", DT_INT32}}),
37 NDef("stop", "Const", {}, {{"value", 10}, {"dtype", DT_INT32}}),
38 NDef("step", "Const", {}, {{"value", 1}, {"dtype", DT_INT32}}),
39 NDef("range", "RangeDataset", {"start", "stop", "step"}, {}),
40 NDef("cycle_length", "Const", {}, {{"value", 1}, {"dtype", DT_INT32}}),
41 NDef("block_length", "Const", {}, {{"value", 1}, {"dtype", DT_INT32}}),
42 NDef("num_parallel_calls", "Const", {},
43 {{"value", 1}, {"dtype", DT_INT32}}),
44 graph_tests_utils::MakeParallelInterleaveV2Node(
45 "interleave", "range", "cycle_length", "block_length",
46 "num_parallel_calls", "XTimesTwo", /*sloppy=*/false)},
47 // FunctionLib
48 {
49 test::function::XTimesTwo(),
50 });
51
52 MakeSloppy optimizer;
53 GraphDef output;
54 TF_ASSERT_OK(optimizer.Optimize(nullptr, item, &output));
55 EXPECT_TRUE(graph_utils::ContainsGraphNodeWithName("interleave", output));
56 int index = graph_utils::FindGraphNodeWithName("interleave", output);
57 EXPECT_TRUE(output.node(index).attr().at("sloppy").b());
58}
59
60TEST(MakeSloppy, ParallelMap) {
61 using test::function::NDef;

Callers

nothing calls this directly

Calls 13

GDefFunction · 0.85
NDefFunction · 0.85
XTimesTwoFunction · 0.85
FindGraphNodeWithNameFunction · 0.85
MakeParallelMapNodeFunction · 0.85
MakeParseExampleNodeFunction · 0.85
attrMethod · 0.80
OptimizeMethod · 0.45
bMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected