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

Function LocalAddressSpec

tensorflow/core/common_runtime/colocation_graph.cc:556–569  ·  view source on GitHub ↗

Returns ParsedName whose address space (i.e. job, replica, task) identifies the address space directly accessible by the local process. If the address space is fully specified and it is exactly the same as the address space of a device, then all kernels of that device should be registered in the local process.

Source from the content-addressed store, hash-verified

554// of a device, then all kernels of that device should be registered in the
555// local process.
556static const DeviceNameUtils::ParsedName LocalAddressSpec(
557 const Device* client_device, const Device* default_local_device) {
558 if (client_device != nullptr) {
559 return DeviceNameUtils::AddressSpace(client_device->parsed_name());
560 }
561
562 if (default_local_device != nullptr) {
563 return DeviceNameUtils::AddressSpace(default_local_device->parsed_name());
564 }
565
566 // TODO(b/139617593) Return the name of the first local device in device_set_
567 // once we can trust the output of Device::IsLocal().
568 return DeviceNameUtils::ParsedName();
569}
570
571ColocationGraph::ColocationGraph(const Graph* graph, const FunctionStack& stack,
572 const FunctionLibraryDefinition* flib_def,

Callers 1

ColocationGraphMethod · 0.85

Calls 1

ParsedNameClass · 0.85

Tested by

no test coverage detected