| 397 | } |
| 398 | |
| 399 | TFE_Context* TFE_NewContextFromSession(const TFE_ContextOptions* opts, |
| 400 | TF_Session* sess, TF_Status* status) { |
| 401 | const tensorflow::DeviceMgr* device_mgr = nullptr; |
| 402 | status->status = sess->session->LocalDeviceManager(&device_mgr); |
| 403 | if (!status->status.ok()) return nullptr; |
| 404 | tensorflow::Rendezvous* r = |
| 405 | new tensorflow::IntraProcessRendezvous(device_mgr); |
| 406 | |
| 407 | return new TFE_Context(opts->session_options.options, |
| 408 | opts->device_placement_policy, opts->mirroring_policy, |
| 409 | opts->async, device_mgr, /*device_mgr_owned*/ false, r, |
| 410 | tensorflow::GetDefaultCustomKernelCreator()); |
| 411 | } |
| 412 | |
| 413 | void TFE_DeleteContext(TFE_Context* ctx) { delete ctx; } |
| 414 |
no test coverage detected