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

Function TEST_F

tensorflow/core/common_runtime/executor_test.cc:156–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154#define BOB "/job:j/replica:0/task:0/device:GPU:0"
155
156TEST_F(ExecutorTest, SimpleAdd) {
157 // c = a + b
158 auto g = absl::make_unique<Graph>(OpRegistry::Global());
159 auto in0 = test::graph::Recv(g.get(), "a", "float", ALICE, 1, BOB);
160 auto in1 = test::graph::Recv(g.get(), "b", "float", ALICE, 1, BOB);
161 auto tmp = test::graph::Add(g.get(), in0, in1);
162 test::graph::Send(g.get(), tmp, "c", BOB, 1, ALICE);
163 Create(std::move(g));
164 Rendezvous::Args args;
165 TF_ASSERT_OK(rendez_->Send(Key(ALICE, kIncarnation, BOB, "a"), args, V(1.0),
166 false)); // in0 = 1.0
167 TF_ASSERT_OK(rendez_->Send(Key(ALICE, kIncarnation, BOB, "b"), args, V(1.0),
168 false)); // in1 = 1.0
169 TF_ASSERT_OK(Run(rendez_));
170 Tensor out = V(-1);
171 bool is_dead = false;
172 TF_ASSERT_OK(
173 rendez_->Recv(Key(BOB, kIncarnation, ALICE, "c"), args, &out, &is_dead));
174 EXPECT_EQ(2.0, V(out)); // out = 1.0 + 1.0 = 2.0
175}
176
177TEST_F(ExecutorTest, SelfAdd) {
178 // v0 <- a

Callers

nothing calls this directly

Calls 15

BuildConcurrentAddAssignFunction · 0.85
NewLocalRendezvousFunction · 0.85
SchedClosureFunction · 0.85
DefaultFunction · 0.85
RecvFunction · 0.70
SendFunction · 0.70
KeyFunction · 0.70
VFunction · 0.70
BuildTreeFunction · 0.70
VBFunction · 0.70
ArgsClass · 0.70
VDFunction · 0.70

Tested by

no test coverage detected