torch cuda is available to tensor code example Example: pytorch get gpu number torch.cuda.device_count()