def make_dataset(files_dataset, shard_index):
    'Returns dataset for sharded tf record files.'
    if (pre_batch_size != batch_size):
        raise ValueError('Pre-batch ({}) size is not equal to batch size ({})'.format(pre_batch_size, batch_size))
    files_dataset = files_dataset.shard(NUM_SHARDS, shard_index)
    dataset = files_dataset.interleave(tf.data.TFRecordDataset)
    decode_fn = functools.partial(data_pipeline.DatasetManager.deserialize, batch_size=pre_batch_size, is_training=is_training)
    dataset = dataset.map(decode_fn, num_parallel_calls=tf.data.experimental.AUTOTUNE)
    return dataset
Returns dataset for sharded tf record files.
def make_dataset(files_dataset, shard_index):
    
    if (pre_batch_size != batch_size):
        raise ValueError('Pre-batch ({}) size is not equal to batch size ({})'.format(pre_batch_size, batch_size))
    files_dataset = files_dataset.shard(NUM_SHARDS, shard_index)
    dataset = files_dataset.interleave(tf.data.TFRecordDataset)
    decode_fn = functools.partial(data_pipeline.DatasetManager.deserialize, batch_size=pre_batch_size, is_training=is_training)
    dataset = dataset.map(decode_fn, num_parallel_calls=tf.data.experimental.AUTOTUNE)
    return dataset