def eval_input_fn(): eval_files_copy = list(eval_files) shuffle(eval_files_copy) eval_files_copy = tf.data.TFRecordDataset(eval_files_copy) dataset = DatasetSource(eval_files_copy, hparams) dataset = dataset.make_source_and_target().filter_by_max_output_length( ).repeat().group_by_batch(batch_size=1) return dataset.dataset
def predict_input_fn(): records = tf.data.TFRecordDataset(list(test_files)) dataset = DatasetSource(records, hparams) batched = dataset.make_source_and_target().group_by_batch( batch_size=1).arrange_for_prediction() return batched.dataset