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

Function TEST_F

tensorflow/cc/ops/while_loop_test.cc:91–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91TEST_F(WhileLoopTest, Basic) {
92 // Create loop: while (i < 10) i += 1
93 Init(1);
94 CreateLoop(LessThanTenCond, AddOneBody);
95
96 // Verify some output invariants
97 WhileContext* while_ctx;
98 for (int i = 0; i < outputs_.size(); ++i) {
99 Node* node = outputs_[i].node();
100 ASSERT_TRUE(node->IsExit()) << "Output node " << i << ":\n"
101 << node->DebugString();
102 ASSERT_TRUE(node->while_ctx() != nullptr) << i;
103 if (i == 0) {
104 while_ctx = node->while_ctx();
105 EXPECT_EQ(while_ctx->frame_name(), kFrameName);
106 } else {
107 EXPECT_EQ(node->while_ctx(), while_ctx) << i;
108 }
109 }
110
111 // Run the loop and test we get the expected results
112 Run<int>({1}, {10});
113 Run<int>({11}, {11});
114}
115
116TEST_F(WhileLoopTest, WrongCondOutputType) {
117 Init(1);

Callers

nothing calls this directly

Calls 12

IsExitMethod · 0.80
while_ctxMethod · 0.80
InitFunction · 0.50
PlaceholderFunction · 0.50
LessFunction · 0.50
AddFunction · 0.50
sizeMethod · 0.45
nodeMethod · 0.45
DebugStringMethod · 0.45
statusMethod · 0.45
push_backMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected