Skip to content

Commit

Permalink
MAINT: only call cuda current device if there is GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
akiyamasho committed Nov 3, 2020
1 parent c77acd6 commit 1d6a3cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
import random

import torch
torch.cuda.current_device()

if torch.cuda.is_available():
torch.cuda.current_device()

import torchvision.transforms.functional as TF
from torch.utils.data import Dataset, DataLoader, Subset
from torchvision import transforms, utils
Expand Down

0 comments on commit 1d6a3cb

Please sign in to comment.