import torch


def get_torch_device(args):
    """Get the torch device based on availability and cli params"""
    if args.cuda:
        if torch.cuda.is_available():
            device = torch.device("cuda:0")
            if args.verbose:
                print("Using CUDA")
        else:
            # quietly use cpu
            device = torch.device("cpu:0")
    else:
        device = torch.device("cpu:0")

    return device