Accelerator

class lightning.pytorch.accelerators.Accelerator[source]

Bases: Accelerator, 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]

Called by the Trainer to set up the accelerator before the model starts running on the device.

Parameters:

trainer (Trainer) – the trainer instance

Return type:

None