Ë
    ©sgo  ã                   óº   — d dl Z d„ Z e«       r"e j                  j                  «       s ed«      ‚ e«       rd dlmZmZmZm	Z	m
Z
mZmZmZmZmZmZ  G d„ d«      Zy)é    Nc                  ó6   — t        t        j                  d«      S )NÚ_dist_autograd_init)ÚhasattrÚtorchÚ_C© ó    úV/var/www/html/venv/lib/python3.12/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_gradientsc                   ó   — e Zd ZdZd„ Zd„ Zy)Úcontexta!  
    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   — t        «       | _        | j                  j                  «       S ©N)r   Úautograd_contextÚ_context_id)Úselfs    r
   Ú	__enter__zcontext.__enter__0   s!   € Ü ,£ˆÔØ×$Ñ$×0Ñ0Ó2Ð2r	   c                 óJ   — t        | j                  j                  «       «       y r   )r   r   r   )r   ÚtypeÚvalueÚ	tracebacks       r
   Ú__exit__zcontext.__exit__4   s   € Ü˜×.Ñ.×:Ñ:Ó<Õ=r	   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r#   r   r	   r
   r   r      s   „ ñò$3ó>r	   r   )r   r   r   r   ÚRuntimeErrorÚtorch._C._distributed_autogradr   r   r   r   r   r   r   r   r   r   r   r   r   r	   r
   ú<module>r*      sT   ðó ò4ñ „>˜%Ÿ(™(×6Ñ6Ô8Ù
ÐHÓ
IÐIá„>÷÷ ÷ ñ ÷>ò >r	   