Maybe something in the spirit of a  use_cuda flag somewhere in the project (e.g. a gpu_utils.py file) and defines tensors directly on the right device could be useful:
FloatTensor = torch.cuda.FloatTensor if use_cuda else torch.FloatTensor
LongTensor = torch.cuda.LongTensor if use_cuda else torch.LongTensor
ByteTensor = torch.cuda.ByteTensor if use_cuda else torch.ByteTensor

Or just enclose all “.cuda()” calls with a condition on use_cuda.
(you will also need to take extra care if you need to load models trained on GPU from CPU…)
Hope that helps !