| 42 | } // namespace |
| 43 | |
| 44 | Maybe<Scope> MakeScope(const JobConfigProto& config_proto, const Device& device) { |
| 45 | std::shared_ptr<Scope> scope; |
| 46 | JUST(PhysicalRun([&](InstructionsBuilder* builder) -> Maybe<void> { |
| 47 | int64_t session_id = JUST(GetDefaultSessionId()); |
| 48 | std::string device_tag = "cpu"; |
| 49 | std::string machine_ids = "0"; |
| 50 | std::string device_ids = "0"; |
| 51 | if (device.type() != "cpu") { |
| 52 | device_tag = device.type(); |
| 53 | device_ids = std::to_string(device.device_id()); |
| 54 | } |
| 55 | scope = JUST(builder->BuildInitialScope(session_id, config_proto, device_tag, |
| 56 | {machine_ids + ":" + device_ids}, nullptr, false)); |
| 57 | return Maybe<void>::Ok(); |
| 58 | })); |
| 59 | return scope; |
| 60 | } |
| 61 | |
| 62 | Maybe<Scope> MakeInitialScope(const JobConfigProto& job_conf, Symbol<ParallelDesc> placement, |
| 63 | bool is_local) { |
no test coverage detected