def tolist(x: Union[(List[Any], torch.Tensor)]):
    return (x.tolist() if isinstance(x, torch.Tensor) else x)
def tolist(x: Union[(List[Any], torch.Tensor)]):
    return (x.tolist() if isinstance(x, torch.Tensor) else x)