
    i                     0    d dl mZ 	 d	dededededdf
dZy)
    )Tensorpredstargetnum_outputsallow_1d_reshapereturnNc                    | j                   dkD  s|j                   dkD  r&t        d|j                    d| j                    d      d}|s+|dk(  xr$ | j                   dk(  xs | j                  d   dk(   }|dkD  xr# | j                   dkD  xr || j                  d   k7  }|s|rt        d| d| j                  d    d      y)	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cond2s         }/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/torchmetrics/functional/regression/utils.py _check_data_shape_to_num_outputsr      s     zzA~q}E%**Q8
 	
 Eq Q%**/*PU[[^q=P%Q!OP

QP;%++a.3PE^_j^kEKKN#1&
 	
     )F)torchr   intboolr    r   r   <module>r      s>     OT

!
03
GK
	
r   