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

Function TEST

tensorflow/compiler/jit/mark_for_cuda_graph_mode_pass_test.cc:90–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90TEST(CudaGraphModeCompilationTest, Chains) {
91 std::unique_ptr<Graph> graph(new Graph(OpRegistry::Global()));
92 {
93 GraphDefBuilder builder(GraphDefBuilder::kFailImmediately);
94 Node* a =
95 ops::SourceOp("UncompilableNullary", builder.opts().WithName("A"));
96 Node* b = ops::UnaryOp("Elu", a, builder.opts().WithName("B"));
97 Node* c = ops::UnaryOp("Elu", b, builder.opts().WithName("C"));
98 Node* d =
99 ops::UnaryOp("UncompilableUnary", c, builder.opts().WithName("D"));
100 Node* e = ops::UnaryOp("Elu", d, builder.opts().WithName("E"));
101 ops::UnaryOp("Elu", e, builder.opts().WithName("F"));
102 TF_EXPECT_OK(GraphDefBuilderToGraph(builder, graph.get()));
103 }
104
105 TF_ASSERT_OK(MarkForCudaGraphModePassTestHelper::MarkForCompilation(&graph));
106 auto clusters = GetClusters(*graph);
107 EXPECT_EQ(6, clusters.size());
108 EXPECT_EQ(clusters["B"], clusters["C"]);
109 EXPECT_EQ(clusters["E"], clusters["F"]);
110 EXPECT_EQ(clusters["B"], clusters["E"]);
111}
112} // namespace
113} // namespace tensorflow

Callers

nothing calls this directly

Calls 8

SourceOpFunction · 0.85
GraphDefBuilderToGraphFunction · 0.85
MarkForCompilationFunction · 0.70
GetClustersFunction · 0.70
UnaryOpClass · 0.50
WithNameMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected