o
    "’×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   aJ  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:
    - fake 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 fake 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	   ú\/home/ubuntu/SoloSpeech/.venv/lib/python3.10/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   z„This 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
   