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

Method Register

tensorflow/core/distributed_runtime/graph_mgr.cc:297–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297Status GraphMgr::Register(const string& handle, const GraphDef& gdef,
298 WorkerSession* session,
299 const GraphOptions& graph_options,
300 const DebugOptions& debug_options,
301 int64 collective_graph_key,
302 DistributedFunctionLibraryRuntime* cluster_flr,
303 string* graph_handle) {
304 Item* item = new Item;
305 Status s = InitItem(handle, gdef, session, graph_options, debug_options,
306 collective_graph_key, cluster_flr, item);
307 if (!s.ok()) {
308 item->Unref();
309 return s;
310 }
311
312 // Inserts one item into table_.
313 {
314 mutex_lock l(mu_);
315 *graph_handle = strings::Printf("%016llx", ++next_id_);
316 item->handle = *graph_handle;
317 CHECK(table_.insert({*graph_handle, item}).second);
318 }
319 return Status::OK();
320}
321
322Status GraphMgr::Deregister(const string& handle) {
323 Item* item = nullptr;

Callers 1

RegisterGraphAsyncMethod · 0.45

Calls 4

PrintfFunction · 0.85
okMethod · 0.45
UnrefMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected