Shortcuts

EvaluationLoop

class pytorch_lightning.loops.dataloader.EvaluationLoop[source]

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

Loops over all dataloaders for evaluation.

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

Performs evaluation on one single dataloader.

Return type

None

connect(epoch_loop)[source]

Connect the evaluation epoch loop with this loop.

on_run_end()[source]

Runs the _on_evaluation_epoch_end hook.

Return type

List[Dict[str, Union[Tensor, Dict[str, Tensor]]]]

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

Runs the _on_evaluation_model_eval, _on_evaluation_start and _on_evaluation_epoch_start hooks.

Return type

None

on_skip()[source]

The function to run when run() should be skipped, determined by the condition in skip.

Return type

List

Returns

the default output value of on_run_end()

reset()[source]

Resets the internal state of the loop.

Return type

None

teardown()[source]

Use to release memory etc.

Return type

None

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

Returns the validation or test dataloaders.

property done: bool

Returns whether all dataloaders are processed or evaluation should be skipped altogether.

property num_dataloaders: int

Returns the total number of dataloaders.

property skip: bool

Returns whether the evaluation should be skipped.