+
    &j                     T    R t ^ RIHt  ! R R4      t ! R R]P                  4      tR# )z3Functionality for Python <-> C++ frontend inter-op.)nnc                      a  ] tR t^t o RtV 3R lR lt]R 4       tR tR t	R t
R tV 3R	 lR
 ltV 3R lR ltR tRtV tR# )OrderedDictWrappera  A wrapper around a C++ OrderedDict.

It dynamically evaluates the OrderedDict getter on a bound C++ module, such
that new changes on the C++ side are picked up. Otherwise accessing e.g.
``cpp_module._parameters`` just once would get a frozen copy of the parameters
at the time of access. ``torch.nn.Module`` accesses ``_parameters`` et al. via ``self.__dict__``
so using properties does not work.
c                   < V ^8  d   QhRR/#    returnN )format__classdict__s   "d/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/nn/cpp.py__annotate__OrderedDictWrapper.__annotate__   s      D     c                    Wn         W n        R # N)
cpp_moduleattr)selfr   r   s   &&&r   __init__OrderedDictWrapper.__init__   s    $	r   c                B    \        V P                  V P                  4      # r   )getattrr   r   r   s   &r   cpp_dictOrderedDictWrapper.cpp_dict   s    t		22r   c                6    V P                   P                  4       # r   )r   itemsr   s   &r   r   OrderedDictWrapper.items   s    }}""$$r   c                6    V P                   P                  4       # r   )r   keysr   s   &r   r    OrderedDictWrapper.keys   s    }}!!##r   c                6    V P                   P                  4       # r   )r   valuesr   s   &r   r#   OrderedDictWrapper.values"   s    }}##%%r   c                6    V P                   P                  4       # r   )r   __iter__r   s   &r   r&   OrderedDictWrapper.__iter__%   s    }}%%''r   c                    < V ^8  d   QhRS[ /# r   r   )int)r
   r   s   "r   r   r   (   s     ' ' 'r   c                6    V P                   P                  4       # r   )r   __len__r   s   &r   r,   OrderedDictWrapper.__len__(   s    }}$$&&r   c                    < V ^8  d   QhRS[ /# r)   )bool)r
   r   s   "r   r   r   +   s     / /4 /r   c                8    V P                   P                  V4      # r   )r   __contains__r   keys   &&r   r1   OrderedDictWrapper.__contains__+   s    }}))#..r   c                8    V P                   P                  V4      # r   )r   __getitem__r2   s   &&r   r6   OrderedDictWrapper.__getitem__.   s    }}((--r   )r   r   N)__name__
__module____qualname____firstlineno____doc__r   propertyr   r   r    r#   r&   r,   r1   r6   __static_attributes____classdictcell__)r   s   @r   r   r      sZ       3 3%$&(' '/ /. .r   r   c                      a a ] tR t^2t oRtV3R lV 3R lltRR lt]R 4       t]P                  V3R lR l4       tV3R lR	 lt
R
tVtV ;t# )ModuleWrapperz\A subclass of ``torch.nn.Module`` that wraps a C++ frontend module and delegates all access.c                   < V ^8  d   QhRR/# r   r	   )r
   r   s   "r   r   ModuleWrapper.__annotate__5   s     D Dd Dr   c           	     ,  < Wn         \        SV `	  4        \        VR 4      V n        \        VR4      V n        \        VR4      V n        \        V4       F<  pVP                  R4      '       d   K  \        W\        V P                   V4      4       K>  	  R# )_parameters_buffers_modules_N)r   superr   r   rE   rF   rG   dir
startswithsetattrr   )r   r   r   	__class__s   && r   r   ModuleWrapper.__init__5   sr     %-j-H,>z:,V,>z:,V
OD??3''GDOOT$BC $r   c                4   V P                  4        FU  pV! VP                  4      Vn        VP                  f   K*  V! VP                  P                  4      VP                  n        KW  	  V P                  4        F  pV! VP                  4      Vn        K  	  V # r   )
parametersdata_gradbuffers)r   fnrecurseparambufs   &&&  r   _applyModuleWrapper._applyB   sq    __&E EJJEJ{{&#%ekk&6&6#7  ' <<>C#((|CH " r   c                .    V P                   P                  # r   )r   trainingr   s   &r   r[   ModuleWrapper.trainingP   s     '''r   c                   < V ^8  d   QhRR/# r   r	   )r
   r   s   "r   r   rC   V   s     $ $ $r   c                <    V P                   P                  V4       R # r   )r   train)r   modes   &&r   r[   r\   U   s    d#r   c                    < V ^8  d   QhRS[ /# r)   )str)r
   r   s   "r   r   rC   Y   s     * *# *r   c                6    V P                   P                  4       # r   )r   __repr__r   s   &r   rd   ModuleWrapper.__repr__Y   s    ''))r   )rF   rG   rE   r   )T)r8   r9   r:   r;   r<   r   rX   r=   r[   setterrd   r>   r?   __classcell__)rM   r   s   @@r   rA   rA   2   sT     fD D ( ( __$ $* * *r   rA   N)r<   torchr   r   ModulerA   r	   r   r   <module>rj      s&    9 (. (.V(*BII (*r   