
    קgd                         U d dl mZmZmZ d dlmZ  G d d          Zi aeej        ef         e	d<   dej        deddfd	Z
dej        dee         fd
ZdS )    )castDictOptionalNc                       e Zd ZdS )_StateN)__name__
__module____qualname__     _/var/www/html/ai-engine/env/lib/python3.11/site-packages/torch/distributed/_composable_state.pyr   r      s        Dr   r   _module_state_mappingmodulestatereturnc                 H    | t           vsJ d|  d            |t           | <   d S )Nz
Inserting z more than once.)r   )r   r   s     r   _insert_module_stater      s9    ....0UV0U0U0U...$)&!!!r   c                     t          | t                    rt          t          |           S | t          v rt          |          S dS )at  
    Return the ``_State`` in ``model``.

    Given a ``module``, this API finds out if the module is also a ``_State``
    instance or if the module is managed by a composable API. If the module
    is also a ``_State``, ``module`` will be casted to ``_State` and returned.
    If it is managed by a composable API, the corresponding ``_State`` will
    be returned.
    N)
isinstancer   r   r   )r   s    r   _get_module_stater      sD     &&!! FF### ***(004r   )typingr   r   r   torch.nnnnr   r   Module__annotations__r   r   r   r   r   <module>r      s    ' ' ' ' ' ' ' ' ' ' '      	 	 	 	 	 	 	 	 24 tBIv-. 3 3 3* *6 *d * * * *bi HV,<      r   