"official/legacy/image_classification/augment_test.py" did not exist on "34eb30df8355b0b3b4636c490fe1508fdaec7989"
utils.py 278 Bytes
Newer Older
rusty1s's avatar
to csr  
rusty1s committed
1
2
3
4
5
import torch

dtypes = [torch.float, torch.double]

devices = [torch.device('cpu')]
rusty1s's avatar
rusty1s committed
6
if torch.cuda.is_available():
rusty1s's avatar
to csr  
rusty1s committed
7
8
9
    devices += [torch.device('cuda:{}'.format(torch.cuda.current_device()))]


rusty1s's avatar
rusty1s committed
10
11
def tensor(x, dtype, device):
    return torch.tensor(x, dtype=dtype, device=device)