class_docstr: Implementation of `RemoteValue`.
class_docstr_tok: ["Implementation","of","`","RemoteValue","`","."]
code: def _copy_to_local(self):
      def copy_tensor(composite_tensor_obj):
          """Copy a remote tensor to local (coordinator)."""
          if isinstance(
              composite_tensor_obj, input_lib.DistributedIterator
          ):
              # A DistributedIterator cannot be copied to local; users should not
              # access that anyway.
              return composite_tensor_obj
  
          with ops.device(
              "/job:%s" % context.get_server_def().job_name
          ):
              # Copying to local (the coordinator) with `tf.device`.
              return array_ops.identity(composite_tensor_obj)
  
      fetched_result = None
      if self._values is not None:
          # When `self._values` is `None`, it indicates the associated function
          # does not have a return value.
          fetched_result = nest.map_structure(copy_tensor, self._values)
      return fetched_result
  
imports: import threading
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops.options import ExternalStatePolicy
  from tensorflow.python.distribute import input_lib
  from tensorflow.python.distribute.coordinator import remote_value
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import function
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import type_spec
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_dataset_ops
  from tensorflow.python.ops import gen_experimental_dataset_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.util import nest
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 10 for calling the RemoteValueImpl obj's underlying member method code with example usage: obj._copy_to_local() and returns: fetched_result, composite_tensor_obj, array_ops