+
    &j)
                         ^ RI t ^ RIHt ^ RIHt R.tRR lt]! ^R4      t]! ^R4      t]! ^R4      t	]! ^R	4      t
R
 tR R ltR R ltR# )    N)repeat)Any'consume_prefix_in_state_dict_if_presentc                     a  V 3R  lpWn         V# )c                    < \        V \        P                  P                  4      '       d   \	        V 4      # \	        \        V S4      4      # N)
isinstancecollectionsabcIterabletupler   )xns   &n/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/nn/modules/utils.pyparse_ntuple.<locals>.parse   s4    a11228OVAq\""    )__name__)r   namer   s   f& r   _ntupler   
   s    #
 NLr   _single_pair_triple
_quadruplec                   a \         ;QJ d     . V3R l\        V 4       4       F  NK  	  5# ! V3R l\        V 4       4       4      # )zReverse the order of `t` and repeat each element for `n` times.

This can be used to translate padding arg used by Conv and Pooling modules
to the ones used by `F.pad`.
c              3   J   <"   T F  p\        S4       F  q!x  K  	  K  	  R # 5ir   )range).0r   _r   s   &  r   	<genexpr>(_reverse_repeat_tuple.<locals>.<genexpr>    s     :KqqAKs    #)r   reversed)tr   s   &fr   _reverse_repeat_tupler$      s/     5:HQK:5:5:HQK:::r   c                ~    V ^8  d   QhR\         \        ,          R\         \        ,          R\         \        ,          /# )   out_sizedefaultsreturn)listint)formats   "r   __annotate__r-   #   s-     
 
c 
d3i 
DI 
r   c                 4   ^ RI p\        V \        VP                  34      '       d   V # \	        V4      \	        V 4      8:  d   \        R\	        V 4      ^,            24      h\        W\	        V 4      ) R RR7       UUu. uF  w  r4Ve   TMTNK  	  upp# u uppi )r   Nz#Input dimension should be at least F)strict)torchr	   r+   SymIntlen
ValueErrorzip)r'   r(   r0   vds   &&   r   _list_with_defaultr7   #   s    (S%,,/00
8}H%>s8}q?P>QRSS CM>+;"<UKKDA ]!K  s   =Bc                V    V ^8  d   QhR\         \        \        3,          R\        RR/# )r&   
state_dictprefixr)   N)dictstrr   )r,   s   "r   r-   r-   0   s3     "M "MS#X"M"M 
"Mr   c                ,   \        V P                  4       4      pV F=  pVP                  V4      '       g   K  V\        V4      R pV P	                  V4      W&   K?  	  \        V R4      '       d   \        V P                  P                  4       4      pV Fz  p\        V4      ^ 8X  d   K  W1P                  RR4      8X  g   VP                  V4      '       g   KD  V\        V4      R pV P                  P	                  V4      V P                  V&   K|  	  R# R# )ax  Strip the prefix in state_dict in place, if any.

.. note::
    Given a `state_dict` from a DP/DDP model, a local model can load it by applying
    `consume_prefix_in_state_dict_if_present(state_dict, "module.")` before calling
    :meth:`torch.nn.Module.load_state_dict`.

Args:
    state_dict (OrderedDict): a state-dict to be loaded to the model.
    prefix (str): prefix.
N	_metadata. )r*   keys
startswithr2   pophasattrr>   replace)r9   r:   rA   keynewkeys   &&   r   r   r   0   s     
!"D>>&!!V'F!+!4J  z;''J((--/0C
 3x1}nnS"--1G1GS[]+/9/C/C/G/G/L
$$V,  (r   )r   )r
   	itertoolsr   typingr   __all__r   r   r   r   r   r$   r7   r    r   r   <module>rL      s_       5
5 !Y
7
!Y
Q%
;
"Mr   