Remove legacy EagerContext constructor

PiperOrigin-RevId: 253598769
This commit is contained in:
Gaurav Jain 2019-06-17 09:43:01 -07:00 committed by TensorFlower Gardener
parent a8bf4193e2
commit 6b1371de93
3 changed files with 4 additions and 17 deletions

View File

@ -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<const DeviceMgr> 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,

View File

@ -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<const DeviceMgr> 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*(const int64)> 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 {

View File

@ -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<tensorflow::DeviceMgr> device_mgr =
auto device_mgr =
absl::make_unique<tensorflow::DeviceMgr>(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();
}