def __init__(self, value, tf_function_cache, type_spec=None, device=None):
    'Creates an instance of a value in this executor.\n\n    Args:\n      value: Depending on `type_spec`, either a `tf.Tensor`, `tf.data.Dataset`,\n        or a nested structure of these stored in an `Struct`.\n      tf_function_cache: A cache obeying `dict` semantics that can be used to\n        look up previously embedded TensorFlow functions.\n      type_spec: An instance of `tff.Type` that represents a tensor, a dataset,\n        or a nested structure of these.\n      device: An optional `tf.config.LogicalDevice` on which to place the value.\n    '
    if (type_spec is None):
        py_typecheck.check_type(value, typed_object.TypedObject)
        type_spec = value.type_signature
    else:
        type_spec = computation_types.to_type(type_spec)
        py_typecheck.check_type(type_spec, computation_types.Type)
    self._type_signature = type_spec
    self._value = to_representation_for_type(value, tf_function_cache, type_spec, device)
Creates an instance of a value in this executor.

Args:
  value: Depending on `type_spec`, either a `tf.Tensor`, `tf.data.Dataset`,
    or a nested structure of these stored in an `Struct`.
  tf_function_cache: A cache obeying `dict` semantics that can be used to
    look up previously embedded TensorFlow functions.
  type_spec: An instance of `tff.Type` that represents a tensor, a dataset,
    or a nested structure of these.
  device: An optional `tf.config.LogicalDevice` on which to place the value.
def __init__(self, value, tf_function_cache, type_spec=None, device=None):
    'Creates an instance of a value in this executor.\n\n    Args:\n      value: Depending on `type_spec`, either a `tf.Tensor`, `tf.data.Dataset`,\n        or a nested structure of these stored in an `Struct`.\n      tf_function_cache: A cache obeying `dict` semantics that can be used to\n        look up previously embedded TensorFlow functions.\n      type_spec: An instance of `tff.Type` that represents a tensor, a dataset,\n        or a nested structure of these.\n      device: An optional `tf.config.LogicalDevice` on which to place the value.\n    '
    if (type_spec is None):
        py_typecheck.check_type(value, typed_object.TypedObject)
        type_spec = value.type_signature
    else:
        type_spec = computation_types.to_type(type_spec)
        py_typecheck.check_type(type_spec, computation_types.Type)
    self._type_signature = type_spec
    self._value = to_representation_for_type(value, tf_function_cache, type_spec, device)