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

Method Prepare

tensorflow/lite/delegates/flex/delegate_data.cc:30–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30tensorflow::Status DelegateData::Prepare(
31 const tensorflow::SessionOptions& session_options) {
32 if (eager_context_) {
33 return tensorflow::Status();
34 }
35
36 std::vector<std::unique_ptr<tensorflow::Device>> devices;
37
38 TF_RETURN_IF_ERROR(tensorflow::DeviceFactory::AddDevices(
39 session_options, "/job:localhost/replica:0/task:0", &devices));
40
41 auto device_mgr =
42 absl::make_unique<tensorflow::DeviceMgr>(std::move(devices));
43 // Note that Rendezvous is ref-counted so it will be automatically deleted.
44 tensorflow::Rendezvous* rendezvous =
45 new tensorflow::IntraProcessRendezvous(device_mgr.get());
46 eager_context_ = new tensorflow::EagerContext(
47 session_options,
48 tensorflow::ContextDevicePlacementPolicy::DEVICE_PLACEMENT_SILENT,
49 tensorflow::ContextMirroringPolicy::MIRRORING_NONE,
50 /*async=*/false, device_mgr.release(), /*device_mgr_owned*/ true,
51 rendezvous, nullptr);
52 return tensorflow::Status();
53}
54
55} // namespace flex
56} // namespace tflite

Callers 4

KernelTestMethod · 0.45
PrepareFunction · 0.45
TESTFunction · 0.45

Calls 3

StatusClass · 0.50
getMethod · 0.45
releaseMethod · 0.45

Tested by 2

KernelTestMethod · 0.36
TESTFunction · 0.36