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

Function TEST

tensorflow/c/eager/c_api_test.cc:131–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129BENCHMARK(BM_Execute_Identity)->Arg(0)->Arg(1);
130
131TEST(CAPI, Context) {
132 TF_Status* status = TF_NewStatus();
133 TFE_ContextOptions* opts = TFE_NewContextOptions();
134 TFE_Context* ctx = TFE_NewContext(opts, status);
135 TFE_DeleteContextOptions(opts);
136
137 TF_DeviceList* devices = TFE_ContextListDevices(ctx, status);
138 EXPECT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
139
140 TFE_DeleteContext(ctx);
141 EXPECT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
142
143 const int num_devices = TF_DeviceListCount(devices);
144 EXPECT_GE(num_devices, 1) << "At least one CPU device should exist";
145 for (int i = 0; i < num_devices; ++i) {
146 EXPECT_NE("", TF_DeviceListName(devices, i, status)) << i;
147 EXPECT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
148 }
149 TF_DeleteDeviceList(devices);
150 TF_DeleteStatus(status);
151}
152
153tensorflow::ServerDef GetServerDef(const string& job_name, int num_tasks) {
154 tensorflow::ServerDef server_def;

Callers

nothing calls this directly

Calls 15

TF_NewStatusFunction · 0.85
TFE_NewContextOptionsFunction · 0.85
TFE_NewContextFunction · 0.85
TFE_DeleteContextOptionsFunction · 0.85
TFE_ContextListDevicesFunction · 0.85
TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85
TFE_DeleteContextFunction · 0.85
TF_DeviceListCountFunction · 0.85
TF_DeleteDeviceListFunction · 0.85
TF_DeleteStatusFunction · 0.85
TestRemoteExecuteFunction · 0.85

Tested by

no test coverage detected