U
    yhd                     @   st   U d dl mZmZmZ d dlmZ G dd dZi aeejef e	d< ejeddddZ
ejee d	d
dZdS )    )castDictOptionalNc                   @   s   e Zd ZdS )_StateN)__name__
__module____qualname__ r	   r	   U/var/www/html/venv/lib/python3.8/site-packages/torch/distributed/_composable_state.pyr      s   r   _module_state_mapping)modulestatereturnc                 C   s$   | t kstd|  d|t | < d S )Nz
Inserting z more than once.)r   AssertionError)r   r   r	   r	   r
   _insert_module_state   s    r   )r   r   c                 C   s,   t | trtt| S | tkr$t|  S d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   r	   r	   r
   _get_module_state   s
    

r   )typingr   r   r   Ztorch.nnnnr   r   Module__annotations__r   r   r	   r	   r	   r
   <module>   s    