import torch


def to_cuda(data):
    """
    put input data into cuda device
    """
    if isinstance(data, tuple):
        return [d.cuda() for d in data]
    elif isinstance(data, torch.Tensor):
        return data.cuda()
    raise RuntimeError