Shortcuts

DataLoaderLoop

class pytorch_lightning.loops.dataloader.dataloader_loop.DataLoaderLoop[source]

Bases: abc.ABC, Generic[pytorch_lightning.loops.base.T]

Base class to loop over all dataloaders.

on_advance_end()[source]

Hook to be called each time after advance is called.

Return type

None

on_advance_start(*args, **kwargs)[source]

Hook to be called each time before advance is called.

Accepts all arguments passed to :attr`run`.

Return type

None

reset()[source]

Resets the internal state.

Return type

None

property current_dataloader: torch.utils.data.dataloader.DataLoader

Returns the current dataloader.

Return type

DataLoader

property current_dataloader_idx: int

Returns the index of the current dataloader.

Return type

int

abstract property dataloaders: Sequence[torch.utils.data.dataloader.DataLoader]

Returns the dataloaders to loop over.

Return type

Sequence[DataLoader]

property done: bool

Returns whether all dataloaders have been processed.

Return type

bool

property num_dataloaders: int

Returns the number of dataloaders present.

Return type

int