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

Function TEST_F

tensorflow/cc/framework/while_gradients_test.cc:91–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89};
90
91TEST_F(WhileGradientsTest, Basic) {
92 // Create loop: while (i < 10) i += 1
93 Init(1);
94 CreateLoop(
95 [](const Scope& s, const std::vector<Output>& inputs, Output* output) {
96 *output = ops::Less(s, inputs[0], 10);
97 return s.status();
98 },
99 [](const Scope& s, const std::vector<Output>& inputs,
100 std::vector<Output>* outputs) {
101 // Use AddN, rather than Add, because the gradient function doesn't
102 // depend on the input shapes, and thus we do not need to store
103 // intermediate values in a stack.
104 outputs->push_back(ops::AddN(s, {inputs[0], 1}));
105 return s.status();
106 });
107 CreateBackprop();
108
109 Run<int>({1}, {1});
110 Run<int>({11}, {1});
111}
112
113TEST_F(WhileGradientsTest, MultipleLoopVars) {
114 // Create loop: while (i < 10) i += j; j += 1; k = k

Callers

nothing calls this directly

Calls 15

ClientSessionClass · 0.85
partition_graphsMethod · 0.80
AddSymbolicGradientsFunction · 0.70
InitFunction · 0.50
LessFunction · 0.50
AddNFunction · 0.50
MultiplyClass · 0.50
LogicalAndClass · 0.50
GreaterClass · 0.50
NegFunction · 0.50
statusMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected