Template Class ChunkDataReader

Page Contents

Class Documentation

template<typename ExampleType_, typename ChunkType_ = std::vector<ExampleType_>>
class torch::data::datasets::ChunkDataReader

Interface for chunk reader, which performs data chunking and reading of entire chunks.

A chunk could be an entire file, such as an audio data file or an image, or part of a file in the case of a large text-file split based on seek positions.

Public Types

using ChunkType = ChunkType_
using ExampleType = ExampleType_

Public Functions

~ChunkDataReader() = default
ChunkType read_chunk(size_t chunk_index) = 0

Read an entire chunk.

size_t chunk_count() = 0

Returns the number of chunks available in this reader.

void reset() = 0

This will clear any internal state associate with this reader.


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources