import torch

use_cuda = torch.cuda.is_available()
device = torch.device('cuda' if use_cuda else 'cpu')
dtype = torch.FloatTensor if not use_cuda else torch.cuda.FloatTensor
dtypeint = torch.LongTensor if not use_cuda else torch.cuda.LongTensor