diff options
-rw-r--r-- | tensorflow/core/common_runtime/eager/context.cc | 7 | ||||
-rw-r--r-- | tensorflow/core/common_runtime/eager/context.h | 7 | ||||
-rw-r--r-- | tensorflow/python/eager/function_test.py | 2 |
3 files changed, 6 insertions, 10 deletions
diff --git a/tensorflow/core/common_runtime/eager/context.cc b/tensorflow/core/common_runtime/eager/context.cc index aaca633cc5..1c5e9a2a31 100644 --- a/tensorflow/core/common_runtime/eager/context.cc +++ b/tensorflow/core/common_runtime/eager/context.cc @@ -34,8 +34,7 @@ EagerContext::EagerContext(const SessionOptions& opts, local_device_manager_.get(), opts.env, TF_GRAPH_DEF_VERSION, &func_lib_def_, {}, thread_pool_.get())), log_device_placement_(opts.config.log_device_placement()), - async_default_(async), - env_(opts.env) { + async_default_(async) { InitDeviceMapAndAsync(); if (opts.config.inter_op_parallelism_threads() > 0) { runner_ = [this](std::function<void()> closure) { @@ -65,7 +64,6 @@ EagerContext::EagerContext( log_device_placement_(opts.config.log_device_placement()), async_default_(async), remote_device_manager_(std::move(remote_device_manager)), - env_(opts.env), server_(std::move(server)), remote_eager_workers_(std::move(remote_eager_workers)), remote_contexts_(remote_contexts) { @@ -118,9 +116,6 @@ Status EagerContext::SetAsyncForThread(bool async) { void EagerContext::ClearCaches() { mutex_lock ml(cache_mu_); gtl::STLDeleteValues(&kernel_cache_); - pflr_.reset(new ProcessFunctionLibraryRuntime( - local_device_manager_.get(), env_, TF_GRAPH_DEF_VERSION, &func_lib_def_, - {}, thread_pool_.get())); } void EagerContext::SetThreadLocalDevicePlacementPolicy( diff --git a/tensorflow/core/common_runtime/eager/context.h b/tensorflow/core/common_runtime/eager/context.h index 6825c39ef3..d0563280bf 100644 --- a/tensorflow/core/common_runtime/eager/context.h +++ b/tensorflow/core/common_runtime/eager/context.h @@ -211,7 +211,10 @@ class EagerContext { std::unique_ptr<thread::ThreadPool> thread_pool_; - std::unique_ptr<ProcessFunctionLibraryRuntime> pflr_; + // One FunctionLibraryRuntime per device. + // func_libs[i] is the FunctionLibraryRuntime corresponding to + // session->devices[i]. + const std::unique_ptr<ProcessFunctionLibraryRuntime> pflr_; std::function<void(std::function<void()>)> runner_; @@ -236,8 +239,6 @@ class EagerContext { const std::unique_ptr<DeviceMgr> remote_device_manager_; - tensorflow::Env* const env_; - // The server_ is not const since we release it when the context is destroyed. // Therefore the server_ object is not marked as const (even though it should // be). diff --git a/tensorflow/python/eager/function_test.py b/tensorflow/python/eager/function_test.py index 13c4ee7f15..cdd9fe1760 100644 --- a/tensorflow/python/eager/function_test.py +++ b/tensorflow/python/eager/function_test.py @@ -138,7 +138,7 @@ class FunctionTest(test.TestCase): out = sq_op(t) self.assertAllEqual(out, math_ops.matmul(t, t).numpy()) - def testRandomSeed(self): + def disabled_testRandomSeed(self): @function.defun def f(): |