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

Function TEST_F

tensorflow/core/kernels/data/single_threaded_executor_test.cc:140–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140TEST_F(ExecutorTest, SimpleAdd) {
141 // c = a + b
142 auto g = absl::make_unique<Graph>(OpRegistry::Global());
143 auto in0 = test::graph::Arg(g.get(), 0, DT_FLOAT);
144 auto in1 = test::graph::Arg(g.get(), 0, DT_FLOAT);
145 auto tmp = test::graph::Add(g.get(), in0, in1);
146 test::graph::Retval(g.get(), 0, tmp);
147 FixupSourceAndSinkEdges(g.get());
148 Create(std::move(g));
149 FunctionCallFrame call_frame({DT_FLOAT, DT_FLOAT}, {DT_FLOAT});
150 TF_ASSERT_OK(call_frame.SetArgs({V(1.0), V(1.0)}));
151 TF_ASSERT_OK(Run(&call_frame));
152 std::vector<Tensor> retvals;
153 TF_ASSERT_OK(call_frame.ConsumeRetvals(&retvals, false));
154 EXPECT_EQ(2.0, V(retvals[0])); // out = 1.0 + 1.0 = 2.0
155}
156
157TEST_F(ExecutorTest, SelfAdd) {
158 // v0 <- a

Callers

nothing calls this directly

Calls 15

FixupSourceAndSinkEdgesFunction · 0.85
SetArgsMethod · 0.80
VFunction · 0.70
BuildTreeFunction · 0.70
ArgFunction · 0.50
AddFunction · 0.50
RetvalFunction · 0.50
CreateFunction · 0.50
RunFunction · 0.50
ConstantFunction · 0.50
UnaryFunction · 0.50
CheckNumericsFunction · 0.50

Tested by

no test coverage detected