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

Function TF_NewServer

tensorflow/c/c_api.cc:2485–2505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2483#endif // !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD)
2484
2485TF_Server* TF_NewServer(const void* proto, size_t proto_len,
2486 TF_Status* status) {
2487#if defined(IS_MOBILE_PLATFORM) || defined(IS_SLIM_BUILD)
2488 status->status = tensorflow::errors::Unimplemented(
2489 "Server functionality is not supported on mobile");
2490 return nullptr;
2491#else
2492 tensorflow::ServerDef server_def;
2493 if (!server_def.ParseFromArray(proto, static_cast<int>(proto_len))) {
2494 status->status = InvalidArgument(
2495 "Could not parse provided bytes into a ServerDef protocol buffer");
2496 return nullptr;
2497 }
2498
2499 std::unique_ptr<tensorflow::ServerInterface> out_server;
2500 status->status = tensorflow::NewServer(server_def, &out_server);
2501 if (TF_GetCode(status) != TF_OK) return nullptr;
2502
2503 return new TF_Server(std::move(out_server));
2504#endif // defined(IS_MOBILE_PLATFORM) || defined(IS_SLIM_BUILD)
2505}
2506
2507void TF_ServerStart(TF_Server* server, TF_Status* status) {
2508#if defined(IS_MOBILE_PLATFORM) || defined(IS_SLIM_BUILD)

Callers 1

Calls 4

UnimplementedFunction · 0.85
InvalidArgumentFunction · 0.85
NewServerFunction · 0.85
TF_GetCodeFunction · 0.85

Tested by

no test coverage detected