diff --git a/tensorflow/c/eager/c_api_internal.h b/tensorflow/c/eager/c_api_internal.h index e2a4cb97ac0..29106e2998d 100644 --- a/tensorflow/c/eager/c_api_internal.h +++ b/tensorflow/c/eager/c_api_internal.h @@ -58,7 +58,7 @@ struct TFE_ContextOptions { TFE_DEVICE_PLACEMENT_SILENT}; TFE_ContextMirroringPolicy mirroring_policy{TFE_MIRRORING_NONE}; // If true, lazily copy the remote inputs of a function to the target devices. - bool lazy_remote_inputs_copy = false; + bool lazy_remote_inputs_copy = true; }; struct TFE_Context { diff --git a/tensorflow/python/eager/context.py b/tensorflow/python/eager/context.py index 19626ec7059..b18f3ebad37 100644 --- a/tensorflow/python/eager/context.py +++ b/tensorflow/python/eager/context.py @@ -405,7 +405,7 @@ class Context(object): if execution_mode is None: execution_mode = SYNC self._default_is_async = execution_mode == ASYNC - self._lazy_remote_inputs_copy = False + self._lazy_remote_inputs_copy = None self._server_def = server_def self._collective_ops_server_def = None self._collective_leader = None @@ -506,9 +506,9 @@ class Context(object): opts, self._mirroring_policy) if self._default_is_async == ASYNC: pywrap_tensorflow.TFE_ContextOptionsSetAsync(opts, True) - if self._lazy_remote_inputs_copy: + if self._lazy_remote_inputs_copy is not None: pywrap_tensorflow.TFE_ContextOptionsSetLazyRemoteInputsCopy( - opts, True) + opts, self._lazy_remote_inputs_copy) context_handle = pywrap_tensorflow.TFE_NewContext(opts) finally: pywrap_tensorflow.TFE_DeleteContextOptions(opts)