How to use the tfrecord.reader.tfrecord_loader function in tfrecord

To help you get started, we’ve selected a few tfrecord examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vahidk / tfrecord / tfrecord / torch / View on Github external
def __iter__(self):
        worker_info =
        if worker_info is not None:
            shard =, worker_info.num_workers
            np.random.seed(worker_info.seed % np.iinfo(np.uint32).max)
            shard = None
        it = reader.tfrecord_loader(
            self.data_path, self.index_path, self.description, shard)
        if self.shuffle_queue_size:
            it = iterator_utils.shuffle_iterator(it, self.shuffle_queue_size)
        if self.transform:
            it = map(self.transform, it)
        return it