o
    H&i                     @   sD   U d dl mZ g dZG dd dZe Zeed< G dd dZdS )	   )AbstractImplHolder)SimpleLibraryRegistrySimpleOperatorEntry	singletonc                   @   s*   e Zd ZdZdd ZdeddfddZd	S )
r   aR  Registry for the "simple" torch.library APIs

    The "simple" torch.library APIs are a higher-level API on top of the
    raw PyTorch DispatchKey registration APIs that includes:
    - abstract impl

    Registrations for these APIs do not go into the PyTorch dispatcher's
    table because they may not directly involve a DispatchKey. For example,
    the abstract impl is a Python function that gets invoked by FakeTensor.
    Instead, we manage them here.

    SimpleLibraryRegistry is a mapping from a fully qualified operator name
    (including the overload) to SimpleOperatorEntry.
    c                 C   s
   i | _ d S N)_data)self r	   IC:\wamp64\www\opt\env\Lib\site-packages\torch/_library/simple_registry.py__init__   s   
zSimpleLibraryRegistry.__init__qualnamereturnr   c                 C   s"   || j vrt|| j |< | j | S r   )r   r   r   r   r	   r	   r
   find   s   

zSimpleLibraryRegistry.findN)__name__
__module____qualname____doc__r   strr   r	   r	   r	   r
   r      s    r   r   c                   @   s   e Zd ZdZdefddZdS )r   zThis is 1:1 to an operator overload.

    The fields of SimpleOperatorEntry are Holders where kernels can be
    registered to.
    r   c                 C   s   || _ t|| _d S r   )r   r   abstract_implr   r	   r	   r
   r   )   s   zSimpleOperatorEntry.__init__N)r   r   r   r   r   r   r	   r	   r	   r
   r   "   s    r   N)r   r   __all__r   r   __annotations__r   r	   r	   r	   r
   <module>   s
    