Shortcuts

GPUAccelerator

class pytorch_lightning.accelerators.GPUAccelerator(precision_plugin, training_type_plugin)[source]

Bases: pytorch_lightning.accelerators.accelerator.Accelerator

Accelerator for GPU devices.

Parameters
  • precision_plugin (PrecisionPlugin) – the plugin to handle precision-specific parts

  • training_type_plugin (TrainingTypePlugin) – the plugin to handle different training routines

on_train_start()[source]

Called when train begins.

Return type

None

setup(trainer, model)[source]
Raises

MisconfigurationException – If the selected device is not GPU.

Return type

None

setup_environment()[source]

Setup any processes or distributed connections. This is called before the LightningModule/DataModule setup hook which allows the user to access the accelerator environment before setup is complete.

Return type

None

teardown()[source]

This method is called to teardown the training process. It is the right place to release memory and free other resources.

Return type

None