import torch


def get_prior_precision(args, device):
    """ Obtain the prior precision parameter from the cmd arguments """

    if type(args.prior_precision) is str: # file path
        prior_precision = torch.load(args.prior_precision, map_location=device)
    elif type(args.prior_precision) is float:
        prior_precision = args.prior_precision
    else:
        raise ValueError('Algorithm not happy with inputs prior precision :(')

    return prior_precision