Ë
    g^(hN
  ã                   ó    — U d dl mZmZ ddlmZ ddlmZ g d¢Z G d„ d«      Z e«       Z	ee
d<    G d	„ d
«      Z G d„ d«      Zdedee   fd„Zy)é    )ÚCallableÚOptionalé   )ÚFakeImplHolder)ÚRegistrationHandle)ÚSimpleLibraryRegistryÚSimpleOperatorEntryÚ	singletonc                   ó&   — e Zd ZdZd„ Zdeddfd„Zy)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                 ó   — i | _         y ©N©Ú_data©Úselfs    ú\/var/www/skyplay_api_hub/venv/lib/python3.12/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Ÿ:™:Ñ%Ü#6°xÓ#@ˆD�J‰J�xÑ Ø�z‰z˜(Ñ#Ð#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ed„ «       Zy)r	   z„This is 1:1 to an operator overload.

    The fields of SimpleOperatorEntry are Holders where kernels can be
    registered to.
    r   c                 óR   — || _         t        |«      | _        t        |«      | _        y r   )r   r   Ú	fake_implÚGenericTorchDispatchRuleHolderÚtorch_dispatch_rulesr   s     r   r   zSimpleOperatorEntry.__init__.   s%   € Ø%ˆŒÜ)7¸Ó)AˆŒä*¨8Ó4ð 	Õ!r   c                 ó   — | j                   S r   )r"   r   s    r   Úabstract_implz!SimpleOperatorEntry.abstract_impl6   s   € à�~‰~Ðr   N)r   r   r   r   r   r   Úpropertyr&   r   r   r   r	   r	   '   s'   „ ñð
 ó 
ð ñó ñr   r	   c                   ó,   — e Zd Zd„ Zdededefd„Zd„ Zy)r#   c                 ó    — i | _         || _        y r   )r   r   r   s     r   r   z'GenericTorchDispatchRuleHolder.__init__<   s   € ØˆŒ
Ø ˆ�r   Útorch_dispatch_classÚfuncr   c                 óœ   ‡ ‡— ‰ j                  ‰«      rt        ‰› d‰ j                  › �«      ‚|‰ j                  ‰<   ˆ ˆfd„}t	        |«      S )Nz8 already has a `__torch_dispatch__` rule registered for c                  ó    •— ‰ j                   ‰= y r   r   ©r   r*   s   €€r   Ú
deregisterz;GenericTorchDispatchRuleHolder.register.<locals>.deregisterI   s   ø€ Ø—
‘
Ð/Ñ0r   )r   ÚRuntimeErrorr   r   r   )r   r*   r+   r/   s   ``  r   Úregisterz'GenericTorchDispatchRuleHolder.register@   sZ   ù€ ð �9‰9Ð)Ô*ÜØ'Ð(Ð(`Ðae×anÑanÐ`oÐpóð ð ,0ˆ�
‰
Ð'Ñ(õ	1ô " *Ó-Ð-r   c                 ó:   — | j                   j                  |d «      S r   )r   Úgetr.   s     r   r   z#GenericTorchDispatchRuleHolder.findN   s   € Ø�z‰z�~‰~Ð2°DÓ9Ð9r   N)	r   r   r   r   Útyper   r   r1   r   r   r   r   r#   r#   ;   s)   „ ò!ð.Ø$(ð.Ø08ð.à	ó.ó:r   r#   r*   r   c                 ór   — t         j                  | j                  «      j                  j                  |«      S r   )r
   r   r   r$   )Úopr*   s     r   Úfind_torch_dispatch_ruler7   R   s+   € Ü�>‰>˜"Ÿ/™/Ó*×?Ñ?×DÑDØóð r   N)Útypingr   r   r"   r   Úutilsr   Ú__all__r   r
   Ú__annotations__r	   r#   r4   r7   r   r   r   ú<module>r<      s_   ðç %Ð %å %Ý %ò H€÷$ñ $ñ2 $9Ó#:€	Ð Ó :÷ñ ÷(:ñ :ð.°tð ÀÈÑ@Rô r   