| 105 | } // namespace |
| 106 | |
| 107 | WorkerSession::WorkerSession(const string& session_name, |
| 108 | const string& worker_name, |
| 109 | std::unique_ptr<WorkerCacheInterface> worker_cache, |
| 110 | std::unique_ptr<DeviceMgr> device_mgr, |
| 111 | std::unique_ptr<GraphMgr> graph_mgr, |
| 112 | std::unique_ptr<DeviceMgr> remote_device_mgr) |
| 113 | : session_name(session_name), |
| 114 | worker_name(worker_name), |
| 115 | worker_cache(new WorkerFreeListCache(std::move(worker_cache))), |
| 116 | graph_mgr(std::move(graph_mgr)), |
| 117 | cluster_flr(new ClusterFunctionLibraryRuntime( |
| 118 | this, !session_name.empty(), |
| 119 | remote_device_mgr ? remote_device_mgr.get() : nullptr)), |
| 120 | device_mgr_(std::move(device_mgr)), |
| 121 | borrowed_device_mgr_(nullptr), |
| 122 | remote_device_mgr_(std::move(remote_device_mgr)) { |
| 123 | // Starts exporting metrics through a platform-specific monitoring API (if |
| 124 | // provided). For builds using "tensorflow/core/platform/default", this is |
| 125 | // currently a no-op. |
| 126 | worker_session_created->GetCell()->Set(true); |
| 127 | monitoring::StartExporter(); |
| 128 | } |
| 129 | |
| 130 | /* static */ |
| 131 | std::shared_ptr<WorkerSession> WorkerSession::CreateWithBorrowedDeviceMgr( |
nothing calls this directly
no test coverage detected