brain_pipe.dataloaders.base.DataLoader

class DataLoader(has_length=True)

Bases: Iterator, ABC

Base class to load data from a source.

DataLoaders are used to load data from a source (e.g. a file) and iterate over it. Therefore, they have an __iter__ method that should be implemented in subclasses.

__init__(has_length=True)

Initialize the DataLoader.

Methods

__init__([has_length])

Initialize the DataLoader.

compute_length()

Compute the length of the DataLoader.

compute_length()

Compute the length of the DataLoader.

Returns:

The length of the DataLoader.

Return type:

int

Notes

This function will be added as the __len__ method if has_length is True. You can override this func