utils.py 112 Bytes
Newer Older
1
2
3
4
5
6
7
import torch

def cuda(x):
    if torch.cuda.is_available():
        return x.cuda()
    else:
        return x