Shortcuts

Accelerator

class lightning.pytorch.accelerators.Accelerator[source]

Bases: lightning.fabric.accelerators.accelerator.Accelerator, abc.ABC

The Accelerator base class for Lightning PyTorch.

Warning

Writing your own accelerator is an experimental feature.

get_device_stats(device)[source]

Get stats for a given device.

Parameters

device (Union[device, str, int]) – device for which to get stats

Return type

Dict[str, Any]

Returns

Dictionary of device stats

setup(trainer)[source]

Setup plugins for the trainer fit and creates optimizers.

Parameters

trainer (Trainer) – the trainer instance

Return type

None