
    Ph                     Z    U d dl mZ g dZ G d d      Z e       Zeed<    G d d      Zy)	   )AbstractImplHolder)SimpleLibraryRegistrySimpleOperatorEntry	singletonc                   &    e Zd ZdZd ZdeddfdZy)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                     i | _         y N)_data)selfs    iC:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\torch/_library/simple_registry.py__init__zSimpleLibraryRegistry.__init__   s	    
    qualnamereturnr   c                 l    || j                   vrt        |      | j                   |<   | j                   |   S r	   )r
   r   r   r   s     r   findzSimpleLibraryRegistry.find   s0    4::%#6x#@DJJx zz(##r   N)__name__
__module____qualname____doc__r   strr    r   r   r   r      s     $S $%: $r   r   r   c                       e Zd ZdZdefdZy)r   zThis is 1:1 to an operator overload.

    The fields of SimpleOperatorEntry are Holders where kernels can be
    registered to.
    r   c                 2    || _         t        |      | _        y r	   )r   r   abstract_implr   s     r   r   zSimpleOperatorEntry.__init__)   s    %1CH1Mr   N)r   r   r   r   r   r   r   r   r   r   r   "   s    N Nr   r   N)r   r   __all__r   r   __annotations__r   r   r   r   <module>r      s3    -
G$ $2 $9#:	  :	N 	Nr   