def _handle_cropped(y_p):
    """
    A straightforward helper that simply averages multiple crops if they are present.

    Parameters
    ----------
    y_p: np.ndarray
         The predicted values with shape batch x targets (x <optional crops>)

    Returns
    -------
    y_p_mean: np.ndarray
              If there is an additional crop dimensions, mean across this dimension
    """
    if len(y_p.shape) == 2:
        return y_p
    elif len(y_p.shape) == 3:
        return y_p.mean(-1)
    else:
        raise ValueError("Predictions should be 1 or 2 dimensions in shape (excluding batches)")