ó
    Eñi‹  ã                  ó  • S SK Jr  S SKJrJr  S SKr\(       a  S SKJr  SS jr\" 5       (       a'  \R                  R                  5       (       d  \" S5      e\" 5       (       a  S SKJrJrJrJrJrJrJrJrJrJrJr  SS	/r " S
 S5      rg)é    )Úannotations)ÚAnyÚTYPE_CHECKINGN)ÚTracebackTypec                 ó6   • [        [        R                  S5      $ )NÚ_dist_autograd_init)ÚhasattrÚtorchÚ_C© ó    Ú`/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/distributed/autograd/__init__.pyÚis_availabler      s   € Ü”5—8‘8Ð2Ó3Ð3r   z/Failed to initialize torch.distributed.autograd)Ú_current_contextÚ_get_debug_infoÚ_get_max_idÚ_initÚ_is_valid_contextÚ_new_contextÚ_release_contextÚ_retrieve_contextÚbackwardÚDistAutogradContextÚget_gradientsÚcontextr   c                  ó<   • \ rS rSrSrSS jr        SS jrSrg)	r   é%   aå  
Context object to wrap forward and backward passes when using
distributed autograd. The ``context_id`` generated in the ``with``
statement  is required to uniquely identify a distributed backward pass
on all workers. Each worker stores metadata associated with this
``context_id``, which is required to correctly execute a distributed
autograd pass.

Example::
    >>> # xdoctest: +SKIP
    >>> import torch.distributed.autograd as dist_autograd
    >>> with dist_autograd.context() as context_id:
    >>>     t1 = torch.rand((3, 3), requires_grad=True)
    >>>     t2 = torch.rand((3, 3), requires_grad=True)
    >>>     loss = rpc.rpc_sync("worker1", torch.add, args=(t1, t2)).sum()
    >>>     dist_autograd.backward(context_id, [loss])
c                óT   • [        5       U l        U R                  R                  5       $ ©N)r   Úautograd_contextÚ_context_id)Úselfs    r   Ú	__enter__Úcontext.__enter__8   s!   € Ü ,£ˆÔØ×$Ñ$×0Ñ0Ó2Ð2r   c                óJ   • [        U R                  R                  5       5        g r   )r   r    r!   )r"   Úexc_typeÚ	exc_valueÚ	tracebacks       r   Ú__exit__Úcontext.__exit__<   s   € ô 	˜×.Ñ.×:Ñ:Ó<Õ=r   )r    N)ÚreturnÚint)r&   ztype[BaseException] | Noner'   zBaseException | Noner(   zTracebackType | Noner+   ÚNone)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r#   r)   Ú__static_attributes__r   r   r   r   r   %   s7   † ñô$3ð>à,ð>ð (ð>ð (ð	>ð
 
÷>r   )r+   Úbool)Ú
__future__r   Útypingr   r   r
   Útypesr   r   r   r   ÚRuntimeErrorÚtorch._C._distributed_autogradr   r   r   r   r   r   r   r   r   r   r   Ú__all__r   r   r   r   Ú<module>r;      ss   ðÝ "ç %ã ö Ý#ô4ñ ‡>�>˜%Ÿ(™(×6Ñ6×8Ñ8Ù
ÐHÓ
IÐIá‡>�>÷÷ ÷ ñ ð �nÐ
%€÷>ò >r   