torch.accelerator.is_available¶
- torch.accelerator.is_available()[source][source]¶
Check if there is an available accelerator.
- Returns
A boolean indicating if there is an available accelerator.
- Return type
Example:
>>> assert torch.accelerator.is_available() "No available accelerators detected."