PyTorch torch.get_default_device Function
PyTorch torch Reference Manual
torch.get_default_deviceIs a function in PyTorch used to get the current default device.
Function Definition
torch.get_default_device()
Usage Example
Example
import torch
device = torch.get_default_device()
print("Default device:", device)
device = torch.get_default_device()
print("Default device:", device)
Other Extensions