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

Method GetFactory

tensorflow/core/distributed_runtime/server_lib.cc:49–68  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

47
48/* static */
49Status ServerFactory::GetFactory(const ServerDef& server_def,
50 ServerFactory** out_factory) {
51 mutex_lock l(*get_server_factory_lock());
52 for (const auto& server_factory : *server_factories()) {
53 if (server_factory.second->AcceptsOptions(server_def)) {
54 *out_factory = server_factory.second;
55 return Status::OK();
56 }
57 }
58
59 std::vector<string> server_names;
60 for (const auto& server_factory : *server_factories()) {
61 server_names.push_back(server_factory.first);
62 }
63
64 return errors::NotFound(
65 "No server factory registered for the given ServerDef: ",
66 server_def.DebugString(), "\nThe available server factories are: [ ",
67 absl::StrJoin(server_names, ", "), " ]");
68}
69
70// Creates a server based on the given `server_def`, and stores it in
71// `*out_server`. Returns OK on success, otherwise returns an error.

Callers

nothing calls this directly

Calls 6

get_server_factory_lockFunction · 0.85
server_factoriesFunction · 0.85
NotFoundFunction · 0.85
AcceptsOptionsMethod · 0.45
push_backMethod · 0.45
DebugStringMethod · 0.45

Tested by

no test coverage detected