§
    Ë²Åj"  ã                   óV   — d Z ddlmZ  G d„ d¦  «        Z G d„ dej        ¦  «        ZdS )z3Functionality for Python <-> C++ frontend inter-op.é    )Únnc                   óX   — e Zd ZdZd„ Zed„ ¦   «         Zd„ Zd„ Zd„ Z	d„ Z
d„ Zd	„ Zd
„ ZdS )Ú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                 ó"   — || _         || _        d S ©N)Ú
cpp_moduleÚattr)Úselfr   r	   s      ú=C:\Projects\Historical\venv\Lib\site-packages\torch/nn/cpp.pyÚ__init__zOrderedDictWrapper.__init__   s   € Ø$ˆŒØˆŒ	ˆ	ˆ	ó    c                 ó6   — t          | j        | j        ¦  «        S r   )Úgetattrr   r	   ©r
   s    r   Úcpp_dictzOrderedDictWrapper.cpp_dict   s   € å�t”¨¬	Ñ2Ô2Ð2r   c                 ó4   — | j                              ¦   «         S r   )r   Úitemsr   s    r   r   zOrderedDictWrapper.items   s   € ØŒ}×"Ò"Ñ$Ô$Ð$r   c                 ó4   — | j                              ¦   «         S r   )r   Úkeysr   s    r   r   zOrderedDictWrapper.keys   s   € ØŒ}×!Ò!Ñ#Ô#Ð#r   c                 ó4   — | j                              ¦   «         S r   )r   Úvaluesr   s    r   r   zOrderedDictWrapper.values"   s   € ØŒ}×#Ò#Ñ%Ô%Ð%r   c                 ó4   — | j                              ¦   «         S r   )r   Ú__iter__r   s    r   r   zOrderedDictWrapper.__iter__%   s   € ØŒ}×%Ò%Ñ'Ô'Ð'r   c                 ó4   — | j                              ¦   «         S r   )r   Ú__len__r   s    r   r   zOrderedDictWrapper.__len__(   s   € ØŒ}×$Ò$Ñ&Ô&Ð&r   c                 ó6   — | j                              |¦  «        S r   )r   Ú__contains__©r
   Úkeys     r   r   zOrderedDictWrapper.__contains__+   s   € ØŒ}×)Ò)¨#Ñ.Ô.Ð.r   c                 ó6   — | j                              |¦  «        S r   )r   Ú__getitem__r   s     r   r!   zOrderedDictWrapper.__getitem__.   s   € ØŒ}×(Ò(¨Ñ-Ô-Ð-r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r   r   r   r   r   r   r!   © r   r   r   r      s±   € € € € € ðð ðð ð ð ð3ð 3ñ „Xð3ð%ð %ð %ð$ð $ð $ð&ð &ð &ð(ð (ð (ð'ð 'ð 'ð/ð /ð /ð.ð .ð .ð .ð .r   r   c                   óf   ‡ — e Zd ZdZˆ fd„Zdd„Zed„ ¦   «         Zej        d„ ¦   «         Zd„ Z	ˆ xZ
S )	ÚModuleWrapperz\A subclass of ``torch.nn.Module`` that wraps a C++ frontend module and delegates all access.c           	      ój  •— || _         t          ¦   «                              ¦   «          t          |d¦  «        | _        t          |d¦  «        | _        t          |d¦  «        | _        t          |¦  «        D ];}|                     d¦  «        s$t          | |t          | j         |¦  «        ¦  «         Œ<d S )NÚ_parametersÚ_buffersÚ_modulesÚ_)r   Úsuperr   r   r+   r,   r-   ÚdirÚ
startswithÚsetattrr   )r
   r   r	   Ú	__class__s      €r   r   zModuleWrapper.__init__5   s­   ø€ ð %ˆŒÝ‰Œ×ÒÑÔÐÝ-¨j¸-ÑHÔHˆÔÝ,>¸zÈ:Ñ,VÔ,VˆŒÝ,>¸zÈ:Ñ,VÔ,VˆŒÝ˜
‘O”Oð 	Dð 	DˆDà—?’? 3Ñ'Ô'ð DÝ˜˜d¥G¨D¬O¸TÑ$BÔ$BÑCÔCÐCøð	Dð 	Dr   Tc                 ó  — |                       ¦   «         D ]=} ||j        ¦  «        |_        |j        � ||j        j        ¦  «        |j        _        Œ>|                      ¦   «         D ]} ||j        ¦  «        |_        Œ| S r   )Ú
parametersÚdataÚ_gradÚbuffers)r
   ÚfnÚrecurseÚparamÚbufs        r   Ú_applyzModuleWrapper._applyB   s   € Ø—_’_Ñ&Ô&ð 	8ð 	8ˆEð ˜˜EœJ™œˆEŒJØŒ{Ð&Ø#% 2 e¤kÔ&6Ñ#7Ô#7�”Ô øà—<’<‘>”>ð 	$ð 	$ˆCØ�r˜#œ(‘|”|ˆCŒHˆHàˆr   c                 ó   — | j         j        S r   )r   Útrainingr   s    r   r?   zModuleWrapper.trainingP   s   € àŒÔ'Ð'r   c                 ó:   — | j                              |¦  «         d S r   )r   Útrain)r
   Úmodes     r   r?   zModuleWrapper.trainingT   s   € àŒ×Ò˜dÑ#Ô#Ð#Ð#Ð#r   c                 ó4   — | j                              ¦   «         S r   )r   Ú__repr__r   s    r   rD   zModuleWrapper.__repr__X   s   € ØŒ×'Ò'Ñ)Ô)Ð)r   )T)r"   r#   r$   r%   r   r=   r&   r?   ÚsetterrD   Ú__classcell__)r3   s   @r   r)   r)   2   sž   ø€ € € € € ØfÐfðDð Dð Dð Dð Dðð ð ð ð ð(ð (ñ „Xð(ð „_ð$ð $ñ „_ð$ð*ð *ð *ð *ð *ð *ð *r   r)   N)r%   Útorchr   r   ÚModuler)   r'   r   r   ú<module>rI      s|   ðà 9Ð 9à Ð Ð Ð Ð Ð ð(.ð (.ð (.ð (.ð (.ñ (.ô (.ð (.ðV'*ð '*ð '*ð '*ð '*�B”Iñ '*ô '*ð '*ð '*ð '*r   