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

Function TFE_NewContextFromSession

tensorflow/c/eager/c_api.cc:399–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399TFE_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
413void TFE_DeleteContext(TFE_Context* ctx) { delete ctx; }
414

Callers 1

Calls 3

LocalDeviceManagerMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected