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

Function TEST

tensorflow/compiler/jit/mark_for_compilation_pass_test.cc:89–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

SourceOpFunction · 0.85
GraphDefBuilderToGraphFunction · 0.85
NextIterationFunction · 0.85
FixupSourceAndSinkEdgesFunction · 0.85
NegateFunction · 0.85
RandomUniformIntFunction · 0.85
StartsWithFunction · 0.85
EndsWithFunction · 0.85
AddCtrlEdgeFunction · 0.85
MakeStageNodeFunction · 0.85
GetWhitelistTableFunction · 0.85
GetKnownXLAWhitelistOpFunction · 0.85

Tested by

no test coverage detected