| 1443 | } |
| 1444 | |
| 1445 | MasterSession::MasterSession( |
| 1446 | const SessionOptions& opt, const MasterEnv* env, |
| 1447 | std::unique_ptr<std::vector<std::unique_ptr<Device>>> remote_devs, |
| 1448 | std::unique_ptr<WorkerCacheInterface> worker_cache, |
| 1449 | std::unique_ptr<DeviceSet> device_set, |
| 1450 | std::vector<string> filtered_worker_list, |
| 1451 | StatsPublisherFactory stats_publisher_factory) |
| 1452 | : session_opts_(opt), |
| 1453 | env_(env), |
| 1454 | handle_(strings::FpToString(random::New64())), |
| 1455 | remote_devs_(std::move(remote_devs)), |
| 1456 | worker_cache_(std::move(worker_cache)), |
| 1457 | devices_(std::move(device_set)), |
| 1458 | filtered_worker_list_(std::move(filtered_worker_list)), |
| 1459 | stats_publisher_factory_(std::move(stats_publisher_factory)), |
| 1460 | graph_version_(0), |
| 1461 | run_graphs_(5), |
| 1462 | partial_run_graphs_(5) { |
| 1463 | UpdateLastAccessTime(); |
| 1464 | CHECK(devices_) << "device_set was null!"; |
| 1465 | |
| 1466 | VLOG(1) << "Session " << handle_ << " #local " << env->local_devices.size() |
| 1467 | << " #remote " << remote_devs_->size(); |
| 1468 | VLOG(1) << "Start master session " << handle_ |
| 1469 | << " with config: " << session_opts_.config.ShortDebugString(); |
| 1470 | } |
| 1471 | |
| 1472 | MasterSession::~MasterSession() { |
| 1473 | for (const auto& iter : run_graphs_) iter.second->Unref(); |
nothing calls this directly
no test coverage detected