o
    .wi                     @   s2   d dl mZ 	ddededededdf
d	d
ZdS )    )TensorFpredstargetnum_outputsallow_1d_reshapereturnNc                 C   s   | j dks
|j dkrtd|j  d| j  dd}|s,|dko+| j dkp*| jd dk }|dko;| j dko;|| jd k}|s@|rNtd| d| jd  ddS )	a  Check that predictions and target have the correct shape, else raise error.

    Args:
        preds: Predicted tensor
        target: Ground truth tensor
        num_outputs: Number of outputs in multioutput setting
        allow_1d_reshape: Allow that for num_outputs=1 that preds and target does not need to be 1d tensors. Instead
            code that follows are expected to reshape the tensors to 1d.

       zWExpected both predictions and target to be either 1- or 2-dimensional tensors, but got z and .F   zPExpected argument `num_outputs` to match the second dimension of input, but got N)ndim
ValueErrorshape)r   r   r   r   cond1cond2 r   e/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/torchmetrics/functional/regression/utils.py _check_data_shape_to_num_outputs   s&   " r   )F)torchr   intboolr   r   r   r   r   <module>   s   