import torch


def pdict_to_parr(d, measures_optimized):
    """Convert parameter dict to BO parameter tensor"""
    if measures_optimized:
        arr = torch.stack([
            torch.tensor(d['p_stay_home']),
        ])
        return arr

    else:
        arr = torch.stack([
            torch.tensor(d['betas']['education']),
            torch.tensor(d['betas']['social']),
            torch.tensor(d['betas']['bus_stop']),
            torch.tensor(d['betas']['office']),
            torch.tensor(d['betas']['supermarket']),
            torch.tensor(d['beta_household']),
        ])
        return arr