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

Method ListDevices

tensorflow/core/distributed_runtime/master_session.cc:1661–1683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1659}
1660
1661Status MasterSession::ListDevices(ListDevicesResponse* resp) const {
1662 if (worker_cache_) {
1663 // This is a ClusterSpec-propagated session, and thus env_->local_devices
1664 // are invalid.
1665
1666 // Mark the "client_device" as the sole local device.
1667 const Device* client_device = devices_->client_device();
1668 for (const Device* dev : devices_->devices()) {
1669 if (dev != client_device) {
1670 *(resp->add_remote_device()) = dev->attributes();
1671 }
1672 }
1673 *(resp->add_local_device()) = client_device->attributes();
1674 } else {
1675 for (Device* dev : env_->local_devices) {
1676 *(resp->add_local_device()) = dev->attributes();
1677 }
1678 for (auto&& dev : *remote_devs_) {
1679 *(resp->add_local_device()) = dev->attributes();
1680 }
1681 }
1682 return Status::OK();
1683}
1684
1685Status MasterSession::Extend(const ExtendSessionRequest* req,
1686 ExtendSessionResponse* resp) {

Callers

nothing calls this directly

Calls 2

client_deviceMethod · 0.80
devicesMethod · 0.45

Tested by

no test coverage detected