Example #1
0
 def _as_variant_tensor(self):
     # pylint: disable=protected-access
     input_resource = self._input_dataset._as_variant_tensor()
     return gen_dataset_ops.shuffle_and_repeat_dataset(
         input_resource,
         buffer_size=self._buffer_size,
         count=self._count,
         seed=self._seed,
         seed2=self._seed2,
         **dataset_ops.flat_structure(self))
Example #2
0
 def _as_variant_tensor(self):
   # pylint: disable=protected-access
   input_resource = self._input_dataset._as_variant_tensor()
   return gen_dataset_ops.shuffle_and_repeat_dataset(
       input_resource,
       buffer_size=self._buffer_size,
       count=self._count,
       seed=self._seed,
       seed2=self._seed2,
       **dataset_ops.flat_structure(self))
Example #3
0
 def _as_variant_tensor(self):
   # pylint: disable=protected-access
   input_resource = self._input_dataset._as_variant_tensor()
   return gen_dataset_ops.shuffle_and_repeat_dataset(
       input_resource,
       buffer_size=self._buffer_size,
       count=self._count,
       seed=self._seed,
       seed2=self._seed2,
       output_types=nest.flatten(
           sparse.as_dense_types(self.output_types, self.output_classes)),
       output_shapes=nest.flatten(
           sparse.as_dense_shapes(self.output_shapes, self.output_classes)))
Example #4
0
 def _as_variant_tensor(self):
     # pylint: disable=protected-access
     input_resource = self._input_dataset._as_variant_tensor()
     return gen_dataset_ops.shuffle_and_repeat_dataset(
         input_resource,
         buffer_size=self._buffer_size,
         count=self._count,
         seed=self._seed,
         seed2=self._seed2,
         output_types=nest.flatten(
             sparse.as_dense_types(self.output_types, self.output_classes)),
         output_shapes=nest.flatten(
             sparse.as_dense_shapes(self.output_shapes,
                                    self.output_classes)))
Example #5
0
 def __init__(self, input_dataset, buffer_size, count=None, seed=None):
   self._input_dataset = input_dataset
   self._buffer_size = ops.convert_to_tensor(
       buffer_size, dtype=dtypes.int64, name="buffer_size")
   if count is None:
     self._count = constant_op.constant(-1, dtype=dtypes.int64, name="count")
   else:
     self._count = ops.convert_to_tensor(
         count, dtype=dtypes.int64, name="count")
   self._seed, self._seed2 = random_seed.get_seed(seed)
   variant_tensor = gen_dataset_ops.shuffle_and_repeat_dataset(
       self._input_dataset._variant_tensor,  # pylint: disable=protected-access
       buffer_size=self._buffer_size,
       count=self._count,
       seed=self._seed,
       seed2=self._seed2,
       **dataset_ops.flat_structure(self))
   super(_ShuffleAndRepeatDataset, self).__init__(input_dataset,
                                                  variant_tensor)
Example #6
0
 def __init__(self, input_dataset, buffer_size, count=None, seed=None):
   self._input_dataset = input_dataset
   self._buffer_size = ops.convert_to_tensor(
       buffer_size, dtype=dtypes.int64, name="buffer_size")
   if count is None:
     self._count = constant_op.constant(-1, dtype=dtypes.int64, name="count")
   else:
     self._count = ops.convert_to_tensor(
         count, dtype=dtypes.int64, name="count")
   self._seed, self._seed2 = random_seed.get_seed(seed)
   variant_tensor = gen_dataset_ops.shuffle_and_repeat_dataset(
       self._input_dataset._variant_tensor,  # pylint: disable=protected-access
       buffer_size=self._buffer_size,
       count=self._count,
       seed=self._seed,
       seed2=self._seed2,
       **dataset_ops.flat_structure(self))
   super(_ShuffleAndRepeatDataset, self).__init__(input_dataset,
                                                  variant_tensor)