+
    TV-j  ã                   óR   € ^ RI t ^ RIHtHtHtHt ^ RIHt RR R llt	RR R llt
R# )	é    N)ÚListÚOptionalÚTupleÚUnionc                ó‚  € V ^8„  d   QhR\         P                  R\        \        \        \
        \        R3,          \        \        ,          3,          ,          R\        \        \        \        \        ,          \
        \        R3,          3,          ,          R\        R\        \        ,          R\         P                  /# )é   ÚinputÚsize.Úscale_factorÚmodeÚalign_cornersÚreturn)
ÚmxÚarrayr   r   Úintr   r   ÚfloatÚstrÚbool)Úformats   "Úq/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/mlx_audio/tts/models/interpolate.pyÚ__annotate__r      s‹   € ÷ 3
ñ 3
Ü�8‰8ð3
ä
”5œœe¤C¨ H�o¬t´C­yÐ8Õ9Õ
:ð3
ô œ5¤¬¬U­´U¼5À#¸:Õ5FÐ!FÕGÕHð3
ô ð	3
ô
 œD•>ð3
ô ‡X�Xñ3
ó    c                ó°  € V P                   pV^8  d   \        RV R24      hV^,
          pVe   Ve   \        R4      hVf   Vf   \        R4      hVe'   \        V\        \        34      '       g   V.V,          pVe'   \        V\        \        34      '       g   V.V,          pVf†   . p\        V4       Ft  p\        ^\        \        P                  ! \        V P                  V^,           ,          4      \        W',          4      ,          4      4      4      pVP                  V4       Kv  	  V^8X  d   \        W^ ,          W44      # \        RV R24      h)ad  Interpolate array with correct shape handling.

Args:
    input (mx.array): Input tensor [N, C, ...] where ... represents spatial dimensions
    size (int or tuple): Output size
    scale_factor (float or tuple): Multiplier for spatial size
    mode (str): 'nearest' or 'linear'
    align_corners (bool): If True, align corners of input and output tensors
z+Expected at least 3D input (N, C, D1), got ÚDz2Only one of size or scale_factor should be definedz+One of size or scale_factor must be definedz/Only 1D interpolation currently supported, got )ÚndimÚ
ValueErrorÚ
isinstanceÚlistÚtupleÚrangeÚmaxr   ÚmathÚceilr   ÚshapeÚappendÚinterpolate1d)	r	   r
   r   r   r   r   Úspatial_dimsÚiÚ	curr_sizes	   &&&&&    r   Úinterpolater*      s@  € ð  �:‰:€DØˆa„xÜÐFÀtÀfÈAÐNÓOÐOà˜!•8€Lð Ò˜LÒ4ÜÐMÓNÐNØ	Š˜,Ò.ÜÐFÓGÐGð Ò¤
¨4´$¼°× ?Ò ?Øˆv˜Õ$ˆØÒ¬
°<Ä$ÌÀ×(OÒ(OØ$�~¨Õ4ˆð ‚|ØˆÜ�|Ö$ˆAäØÜ”D—I’Iœe E§K¡K°°AµÕ$6Ó7¼%ÀÅÓ:PÕPÓQÓRóˆIð �K‰K˜	Ö"ñ %ð �qÔÜ˜U¨¥G¨TÓAÐAäØ=¸l¸^È1ÐMó
ð 	
r   c          
      ó’   € V ^8„  d   QhR\         P                  R\        R\        R\        \
        ,          R\         P                  /# )r   r	   r
   r   r   r   )r   r   r   r   r   r   )r   s   "r   r   r   =   sF   € ÷ 3ñ 3Ü�8‰8ð3ä
ð3ô ð3ô œD•>ð	3ô
 ‡X�Xñ3r   c                óp  € V P                   w  rEpV^8  d   ^pV^8  d   ^pVR8X  d¡   V^8X  d   \        P                  ! ^ .4      pMuWa,          p\        P                  ! \        P                  ! V4      V,          4      P                  \        P                  4      p\        P                  ! V^ V^,
          4      pV RRV3,          # V'       d;   V^8”  d4   \        P                  ! V4      V^,
          V^,
          ,          ,          p	MgV^8X  d   \        P                  ! R.4      p	MH\        P                  ! V4      Wa,          ,          p	V'       g   V	RWa,          ,          ,           R,
          p	V^8X  d   \        P                  ! WWQ34      p
V
# \        P                  ! V	4      P                  \        P                  4      p\        P                  ! V^,           V^,
          4      pW›,
          pV RRV3,          pV RRV3,          pV^V,
          R,          ,          WýR,          ,          ,           p
V
# )z 1D interpolation implementation.ÚnearestºNNNg        g      à?)NNr.   )
r$   r   r   ÚfloorÚarangeÚastypeÚint32ÚclipÚbroadcast_toÚminimum)r	   r
   r   r   Ú
batch_sizeÚchannelsÚin_widthÚindicesÚscaleÚxÚoutputÚx_lowÚx_highÚx_fracÚy_lowÚy_highs   &&&&            r   r&   r&   =   s´  € ð &+§[¡[Ñ"€J˜(ð ˆa„xØˆØ�!„|ØˆàˆyÔØ�1Œ9Ü—h’h ˜s“m‰Gà•OˆEÜ—h’hœrŸyšy¨›°Õ6Ó7×>Ñ>¼r¿x¹xÓHˆGÜ—g’g˜g q¨(°Q­,Ó7ˆGØ�Q˜˜7�]Õ#Ð#÷ ˜ œÜ�IŠI�d‹O ¨1¥°¸µÕ:Õ;‰à�1Œ9Ü—’˜#˜“‰Aä—	’	˜$“ 8¥?Õ3ˆAß Ø˜˜x�Õ/Õ/°#Õ5�ð �1„}Ü—’ °XÐ(DÓEˆØˆä�HŠH�Q‹K×ÑœrŸx™xÓ(€EÜ�ZŠZ˜ �	 8¨a¥<Ó0€FØ�Y€Fð �!�Q˜�+Õ€EØ�1�a˜�<Õ €Fð �a˜&•j -Õ0Õ0°6À=Õ<QÕ3QÕQ€Fà€Mr   )NNr-   N)ÚlinearN)r"   Útypingr   r   r   r   Úmlx.coreÚcorer   r*   r&   © r   r   Ú<module>rG      s!   ðÛ ß /Ó /å ÷3
÷l3ñ 3r   