(dataset, hparams, is_training, batch_size=None)
return dataset
Batch a dataset, optional batch_size override.
Batch a dataset, optional batch_size override.
Batch a dataset optional batch_size override .
def create_batch(dataset, hparams, is_training, batch_size=None):
  """Batch a dataset, optional batch_size override."""
  if not batch_size:
    batch_size = hparams.batch_size
  if hparams.max_expected_train_example_len and is_training:
    dataset = dataset.batch(batch_size, drop_remainder=True)
  else:
    dataset = dataset.padded_batch(
        batch_size,
        padded_shapes=dataset.output_shapes,
        drop_remainder=True)
  return dataset
def create_batch ( dataset , hparams , is_training , batch_size = None ) : if not batch_size : batch_size = hparams . batch_size if hparams . max_expected_train_example_len and is_training : dataset = dataset . batch ( batch_size , drop_remainder = True ) else : dataset = dataset . padded_batch ( batch_size , padded_shapes = dataset . output_shapes , drop_remainder = True ) return dataset