TensorPlay
API symbolsutils
Copy
View MarkdownDownload .md

Sampler

class tensorplay.utils.data.Sampler[source]

Base class for all Samplers.

Every Sampler subclass has to provide an __iter__() method, providing a way to iterate over indices or lists of indices (batches) of dataset elements, and may provide a __len__() method that returns the length of the returned iterators.

Note

The __len__() method isn’t strictly required by DataLoader, but is expected in any calculation involving the length of a DataLoader.

Ask DeepWiki