opennmt/data/dataset.py
def batch_dataset(batch_size, padded_shapes=None):
    """Transformation that batches a dataset.

    Example:

      >>> dataset = dataset.apply(opennmt.data.batch_dataset(...))

    Args:
      batch_size: The batch size.
      padded_shapes: The padded shapes for this dataset. If ``None``, the shapes
        are automatically inferred from the dataset output shapes.

    Returns:
      A ``tf.data.Dataset`` transformation.

    See Also:
      :func:`opennmt.data.batch_sequence_dataset`
    """
    return lambda dataset: dataset.padded_batch(
        batch_size, padded_shapes=padded_shapes or _get_output_shapes(dataset)
    )
Transformation that batches a dataset.

    Example:

      >>> dataset = dataset.apply(opennmt.data.batch_dataset(...))

    Args:
      batch_size: The batch size.
      padded_shapes: The padded shapes for this dataset. If ``None``, the shapes
        are automatically inferred from the dataset output shapes.

    Returns:
      A ``tf.data.Dataset`` transformation.

    See Also:
      :func:`opennmt.data.batch_sequence_dataset`
    
Transformation that batches a dataset.
Transformation that batches a dataset .
def batch_dataset(batch_size, padded_shapes=None):
    return lambda dataset: dataset.padded_batch(
        batch_size, padded_shapes=padded_shapes or _get_output_shapes(dataset)
    )
def batch_dataset ( batch_size , padded_shapes = None ) : return lambda dataset : dataset . padded_batch ( batch_size , padded_shapes = padded_shapes or _get_output_shapes ( dataset ) )
Transformation that batches a dataset.
Transformation that batches a dataset .
"""Transformation that batches a dataset.

    Example:

      >>> dataset = dataset.apply(opennmt.data.batch_dataset(...))

    Args:
      batch_size: The batch size.
      padded_shapes: The padded shapes for this dataset. If ``None``, the shapes
        are automatically inferred from the dataset output shapes.

    Returns:
      A ``tf.data.Dataset`` transformation.

    See Also:
      :func:`opennmt.data.batch_sequence_dataset`
    """
A ``tf.data.Dataset`` transformation.
A ` ` tf . data . Dataset ` ` transformation .
batch_size
The batch size.
The batch size .
padded_shapes
The padded shapes for this dataset. If ``None``, the shapes
are automatically inferred from the dataset output shapes.
The padded shapes for this dataset . If ` ` None ` ` the shapes are automatically inferred from the dataset output shapes .
examples
>>> dataset = dataset.apply(opennmt.data.batch_dataset(...))
>>> dataset = dataset . apply ( opennmt . data . batch_dataset ( ... ))