Pytorch Torch Is_Available
# PyTorch torch.is_available Function
* * PyTorch torch Reference](#)
`torch.is_available` is a PyTorch function used to check CUDA availability. Returns True if CUDA is available, False otherwise.
### Function Definition
torch.is_available()
* * *
## Example Usage
## Example
import torch
# Check if CUDA is available
if torch.is_available():
print("CUDA is available!")
print(f"CUDA device count: {torch.cuda.device_count()}")
else:
print("CUDA is not available")
* * PyTorch torch Reference](#)
YouTip