Home | History | Annotate | Download | only in ops

Lines Matching refs:dataset

25 def get_single_element(dataset):
26 """Returns the single element in `dataset` as a nested structure of tensors.
28 This function enables you to use a @{tf.data.Dataset} in a stateless
31 as a `Dataset`, and you want to use the transformation at serving time.
41 dataset = (tf.data.Dataset.from_tensor_slices(input_batch)
45 image_batch, label_batch = tf.contrib.data.get_single_element(dataset)
49 dataset: A @{tf.data.Dataset} object containing a single element.
53 element of `dataset`.
56 TypeError: if `dataset` is not a `tf.data.Dataset` object.
57 InvalidArgumentError (at runtime): if `dataset` does not contain exactly
60 if not isinstance(dataset, dataset_ops.Dataset):
61 raise TypeError("`dataset` must be a `tf.data.Dataset` object.")
63 dataset.output_types,
65 dataset._as_variant_tensor(), # pylint: disable=protected-access
66 output_types=nest.flatten(dataset.output_types),
67 output_shapes=nest.flatten(dataset.output_shapes)))