def get_sampled_parameter_dimensions(chain, par):
    """Get dimensions of parameter in fit output."""

    if par not in chain:
        raise ValueError(
            "Could not find parameter '%r' in fit output" % par)

    if chain[par].ndim == 1:
        # Output has shape (n_iter,), i.e., parameter is a scalar.
        return ()

    return chain[par].shape[1:]