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

Function TEST_F

tensorflow/core/distributed_runtime/eager/remote_mgr_test.cc:71–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69};
70
71TEST_F(RemoteMgrTest, LocalTensorHandle) {
72 TestRemoteMgr remote_mgr(true, ctx_);
73 Tensor t(DT_FLOAT, TensorShape({0}));
74
75 TensorHandle* handle;
76 TF_ASSERT_OK(TensorHandle::CreateLocalHandle(t, &handle));
77 EXPECT_EQ(nullptr, handle->device());
78 EXPECT_EQ(local_device_, handle->DeviceOrHostCPU(ctx_));
79 const uint64 op_id = remote_mgr.OpId();
80 EXPECT_EQ(1, op_id);
81 RemoteTensorHandle remote_handle;
82 TF_ASSERT_OK(remote_mgr.SerializeRemoteTensorHandle(
83 handle, &remote_handle, handle->device(),
84 handle->DeviceOrHostCPU(ctx_)->name()));
85 EXPECT_EQ(2, remote_mgr.OpId());
86 EXPECT_EQ(op_id, remote_handle.op_id());
87 EXPECT_EQ(0, remote_handle.output_num());
88 EXPECT_EQ(local_device_->name(), remote_handle.device());
89
90 TensorHandle* deserialized_handle;
91 TF_ASSERT_OK(remote_mgr.DeserializeRemoteTensorHandle(remote_handle,
92 &deserialized_handle));
93 tensorflow::TensorHandle* h;
94 TF_EXPECT_OK(remote_mgr.GetTensorHandle(
95 RemoteTensorHandleInternal(remote_handle), &h));
96 TF_ASSERT_OK(
97 remote_mgr.DeleteTensorHandle(RemoteTensorHandleInternal(remote_handle)));
98 EXPECT_FALSE(
99 remote_mgr.GetTensorHandle(RemoteTensorHandleInternal(remote_handle), &h)
100 .ok());
101
102 deserialized_handle->Unref();
103 handle->Unref();
104}
105
106TEST_F(RemoteMgrTest, SerializeLocalTensorHandleWithRemoteMirror) {
107 RemoteMgr remote_mgr(false, ctx_);

Callers

nothing calls this directly

Calls 15

DeviceOrHostCPUMethod · 0.80
OpIdMethod · 0.80
DeleteTensorHandleMethod · 0.80
AddRemoteMirrorMethod · 0.80
nameMethod · 0.65
TensorShapeClass · 0.50
deviceMethod · 0.45
op_idMethod · 0.45
output_numMethod · 0.45

Tested by

no test coverage detected