diff --git a/tensorflow/core/common_runtime/eager/context.cc b/tensorflow/core/common_runtime/eager/context.cc index 59afe213cdb..02ec74c2e6f 100644 --- a/tensorflow/core/common_runtime/eager/context.cc +++ b/tensorflow/core/common_runtime/eager/context.cc @@ -53,14 +53,6 @@ bool ReadBoolFromEnvVar(StringPiece env_var_name, bool default_val) { } // namespace -EagerContext::EagerContext(const SessionOptions& opts, - ContextDevicePlacementPolicy default_policy, - bool async, - std::unique_ptr device_mgr, - Rendezvous* rendezvous) - : EagerContext(opts, default_policy, async, device_mgr.release(), - /*device_mgr_owned*/ true, rendezvous, nullptr) {} - EagerContext::EagerContext( const SessionOptions& opts, ContextDevicePlacementPolicy default_policy, bool async, const DeviceMgr* device_mgr, bool device_mgr_owned, diff --git a/tensorflow/core/common_runtime/eager/context.h b/tensorflow/core/common_runtime/eager/context.h index 087f4fe55cc..5fc5c88d9b0 100644 --- a/tensorflow/core/common_runtime/eager/context.h +++ b/tensorflow/core/common_runtime/eager/context.h @@ -83,12 +83,6 @@ class RunMetadataListener { class EagerContext : public core::RefCounted { public: - // TODO: remove this constructor once we migrate all callers to the next one. - EagerContext(const SessionOptions& opts, - ContextDevicePlacementPolicy default_policy, bool async, - std::unique_ptr device_mgr, - Rendezvous* rendezvous); - EagerContext( const SessionOptions& opts, ContextDevicePlacementPolicy default_policy, bool async, const DeviceMgr* device_mgr, bool device_mgr_owned, @@ -97,7 +91,7 @@ class EagerContext : public core::RefCounted { std::function rendezvous_creator = nullptr, const DeviceMgr* remote_device_mgr = nullptr); - ~EagerContext(); + ~EagerContext() override; // Returns the function library runtime for the given device. FunctionLibraryRuntime* func_lib(const Device* d) const { diff --git a/tensorflow/lite/delegates/flex/delegate_data.cc b/tensorflow/lite/delegates/flex/delegate_data.cc index 1c036c2ebd7..cb6f3e2664a 100644 --- a/tensorflow/lite/delegates/flex/delegate_data.cc +++ b/tensorflow/lite/delegates/flex/delegate_data.cc @@ -37,7 +37,7 @@ tensorflow::Status DelegateData::Prepare( TF_RETURN_IF_ERROR(tensorflow::DeviceFactory::AddDevices( session_options, "/job:localhost/replica:0/task:0", &devices)); - std::unique_ptr device_mgr = + auto device_mgr = absl::make_unique(std::move(devices)); // Note that Rendezvous is ref-counted so it will be automatically deleted. tensorflow::Rendezvous* rendezvous = @@ -45,7 +45,8 @@ tensorflow::Status DelegateData::Prepare( eager_context_ = new tensorflow::EagerContext( session_options, tensorflow::ContextDevicePlacementPolicy::DEVICE_PLACEMENT_SILENT, - /*async=*/false, std::move(device_mgr), rendezvous); + /*async=*/false, device_mgr.release(), /*device_mgr_owned*/ true, + rendezvous, nullptr); return tensorflow::Status(); }