ó
    Eñi…  ã            	       óÈ   • % S SK Jr  S SKJrJr  SSKJr  SSKJr  SSK	J
r
  / SQr " S S	5      r\" 5       r\\S
'    " S S5      r " S S5      rS\S\S\\S\4      4S jrg)é    )ÚCallable)ÚAnyÚOptionalé   )ÚEffectHolder)ÚFakeImplHolder)ÚRegistrationHandle)ÚSimpleLibraryRegistryÚSimpleOperatorEntryÚ	singletonc                   ó4   • \ rS rSrSrS
S jrS\SS4S jrS	rg)r
   é   a"  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.
ÚreturnNc                 ó   • 0 U l         g ©N©Ú_data©Úselfs    Ú[/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/_library/simple_registry.pyÚ__init__ÚSimpleLibraryRegistry.__init__   s	   € Ø57ˆ�
ó    Úqualnamer   c                 óx   • U R                   R                  US 5      nUc  [        U5      =U R                   U'   nU$ r   )r   Úgetr   )r   r   Úress      r   ÚfindÚSimpleLibraryRegistry.find   s8   € Ø�j‰j�n‰n˜X tÓ,ˆØ‰;Ü)<¸XÓ)FÐFˆD�J‰J�xÑ  3Øˆ
r   r   ©r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ústrr   Ú__static_attributes__© r   r   r
   r
      s    † ñô8ð˜Sð Ð%:÷ r   r
   r   c                   óB   • \ rS rSrSrS\SS4S jr\S\4S j5       r	Sr
g)	r   é)   zxThis is 1:1 to an operator overload.

The fields of SimpleOperatorEntry are Holders where kernels can be
registered to.
r   r   Nc                 óp   • Xl         [        U5      U l        [        U5      U l        [        U5      U l        g r   )r   r   Ú	fake_implÚGenericTorchDispatchRuleHolderÚtorch_dispatch_rulesr   Úeffect©r   r   s     r   r   ÚSimpleOperatorEntry.__init__0   s1   € Ø%ŒÜ)7¸Ó)AˆŒä*¨8Ó4ð 	Ô!ô %1°Ó$:ˆ�r   c                 ó   • U R                   $ r   )r,   r   s    r   Úabstract_implÚ!SimpleOperatorEntry.abstract_impl:   s   € à�~‰~Ðr   )r/   r,   r   r.   )r!   r"   r#   r$   r%   r&   r   Úpropertyr   r3   r'   r(   r   r   r   r   )   s5   † ñð; ð ;¨ô ;ð ð˜~ó ó ór   r   c                   óh   • \ rS rSrS\SS4S jrS\S\S\4   S\	4S	 jr
S\S\\S\4      4S
 jrSrg)r-   é?   r   r   Nc                 ó   • 0 U l         Xl        g r   ©r   r   r0   s     r   r   Ú'GenericTorchDispatchRuleHolder.__init__@   s   € Ø57ˆŒ
Ø%�r   Útorch_dispatch_classÚfunc.c                 ó¬   ^ ^• T R                  T5      (       a  [        T ST R                   35      eUT R                  T'   SU U4S jjn[	        U5      $ )Nz8 already has a `__torch_dispatch__` rule registered for c                  ó    >• T R                   T	 g r   r   ©r   r;   s   €€r   Ú
deregisterÚ;GenericTorchDispatchRuleHolder.register.<locals>.deregisterM   s   ø€ Ø—
‘
Ð/Ñ0r   r    )r   ÚRuntimeErrorr   r   r	   )r   r;   r<   r@   s   ``  r   ÚregisterÚ'GenericTorchDispatchRuleHolder.registerD   sb   ù€ ð �9‰9Ð)×*Ñ*ÜØ'Ð(Ð(`Ðae×anÑanÐ`oÐpóð ð ,0ˆ�
‰
Ð'Ñ(÷	1ð 	1ô " *Ó-Ð-r   c                 ó:   • U R                   R                  US 5      $ r   )r   r   r?   s     r   r   Ú#GenericTorchDispatchRuleHolder.findR   s   € Ø�z‰z�~‰~Ð2°DÓ9Ð9r   r9   )r!   r"   r#   r$   r&   r   Útyper   r   r	   rC   r   r   r'   r(   r   r   r-   r-   ?   s\   † ð& ð &¨ô &ð.Ø$(ð.Ø08¸¸c¸Ñ0Bð.à	ô.ð:¨ð :°(¸8ÀCÈÀHÑ;MÑ2N÷ :r   r-   Úopr;   r   .c                 ór   • [         R                  U R                  5      R                  R                  U5      $ r   )r   r   r#   r.   )rH   r;   s     r   Úfind_torch_dispatch_rulerJ   V   s-   € ô �>‰>˜"Ÿ/™/Ó*×?Ñ?×DÑDØóð r   N)Úcollections.abcr   Útypingr   r   Úeffectsr   r,   r   Úutilsr	   Ú__all__r
   r   Ú__annotations__r   r-   rG   rJ   r(   r   r   Ú<module>rQ      su   ðÞ $ß  å !Ý %Ý %ò H€÷ñ ñ4 $9Ó#:€	Ð Ó :÷ñ ÷,:ñ :ð.ØðØ#'ðàˆh�s˜C�xÑ Ñ!õr   