Ë
    g^(hwV  ã                   ó„  — d dl Z d dlZd dlZddlmZ  eej                  d«      s] ed«      ej                  j                  d<    ed«      ej                  j                  d<    ed«      ej                  j                  d<   d dlm	Z	m
Z
mZ d	„ Zd
„ Z G d„ dej                  j                  «      Z G d„ d«      Z	 dd„Zy)é    Né   )Ú_dummy_typeÚ_CudaStreamBaseÚ
_CUDAGraphÚ_graph_pool_handleÚ_cuda_isCurrentStreamCapturing)r   r   r   c                  ó   — t        «       S )zÌReturn True if CUDA graph capture is underway on the current CUDA stream, False otherwise.

    If a CUDA context does not exist on the current device, returns False without initializing the context.
    )r   © ó    úO/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/cuda/graphs.pyÚis_current_stream_capturingr      s   € ô
 *Ó+Ð+r   c                  ó   — t        «       S )zÚReturn an opaque token representing the id of a graph memory pool.

    See :ref:`Graph memory management<graph-memory-management>`.

    .. warning::
        This API is in beta and may change in future releases.
    )r   r
   r   r   Úgraph_pool_handler   "   s   € ô ÓÐr   c                   ój   ‡ — e Zd ZdZˆ fd„Zd
ˆ fd„	Zˆ fd„Zˆ fd„Zˆ fd„Zˆ fd„Z	ˆ fd„Z
ˆ fd	„Zˆ xZS )Ú	CUDAGraphzrWrapper around a CUDA graph.

    .. warning::
        This API is in beta and may change in future releases.
    c                 ó"   •— t         ‰| �  | «      S ©N)ÚsuperÚ__new__)ÚclsÚ	__class__s    €r   r   zCUDAGraph.__new__5   s   ø€ Ü‰w‰˜sÓ#Ð#r   c                 ó(   •— t         ‰| �  ||¬«       y)að  Begin capturing CUDA work on the current stream.

        Typically, you shouldn't call ``capture_begin`` yourself.
        Use :class:`~torch.cuda.graph` or :func:`~torch.cuda.make_graphed_callables`,
        which call ``capture_begin`` internally.

        Arguments:
            pool (optional): Token (returned by :func:`~torch.cuda.graph_pool_handle` or
                :meth:`other_Graph_instance.pool()<torch.cuda.CUDAGraph.pool>`) that hints this graph may share memory
                with the indicated pool.  See :ref:`Graph memory management<graph-memory-management>`.
            capture_error_mode (str, optional): specifies the cudaStreamCaptureMode for the graph capture stream.
                Can be "global", "thread_local" or "relaxed". During cuda graph capture, some actions, such as cudaMalloc,
                may be unsafe. "global" will error on actions in other threads, "thread_local" will only error for
                actions in the current thread, and "relaxed" will not error on these actions. Do NOT change this setting
                unless you're familiar with `cudaStreamCaptureMode <https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85>`_
        )ÚpoolÚcapture_error_modeN)r   Úcapture_begin)Úselfr   r   r   s      €r   r   zCUDAGraph.capture_begin8   s   ø€ ô" 	‰Ñ 4Ð<NÐÕOr   c                 ó"   •— t         ‰| �  «        y)aG  End CUDA graph capture on the current stream.

        After ``capture_end``, ``replay`` may be called on this instance.

        Typically, you shouldn't call ``capture_end`` yourself.
        Use :class:`~torch.cuda.graph` or :func:`~torch.cuda.make_graphed_callables`,
        which call ``capture_end`` internally.
        N)r   Úcapture_end©r   r   s    €r   r   zCUDAGraph.capture_endK   s   ø€ ô 	‰ÑÕr   c                 ó"   •— t         ‰| �  «        y)z,Replay the CUDA work captured by this graph.N)r   Úreplayr   s    €r   r!   zCUDAGraph.replayV   s   ø€ ä‰‰Õr   c                 ó"   •— t         ‰| �  «        y)z1Delete the graph currently held by this instance.N)r   Úresetr   s    €r   r#   zCUDAGraph.resetZ   s   ø€ ä‰‰�r   c                 ó    •— t         ‰| �  «       S )zäReturn an opaque token representing the id of this graph's memory pool.

        This id can optionally be passed to another graph's ``capture_begin``,
        which hints the other graph may share the same memory pool.
        )r   r   r   s    €r   r   zCUDAGraph.pool^   s   ø€ ô ‰w‰|‹~Ðr   c                 ó    •— t         ‰| �  «       S )z/Enable debugging mode for CUDAGraph.debug_dump.)r   Úenable_debug_moder   s    €r   r&   zCUDAGraph.enable_debug_modef   s   ø€ ä‰wÑ(Ó*Ð*r   c                 ó"   •— t         ‰| �  |«      S )zÖ
        Arguments:
            debug_path (required): Path to dump the graph to.

        Calls a debugging function to dump the graph if the debugging is
        enabled via CUDAGraph.enable_debug_mode()
        )r   Ú
debug_dump)r   Ú
debug_pathr   s     €r   r(   zCUDAGraph.debug_dumpj   s   ø€ ô ‰wÑ! *Ó-Ð-r   )NÚglobal)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r!   r#   r   r&   r(   Ú__classcell__)r   s   @r   r   r   .   s6   ø„ ñô$õPô&	ôôôô+÷.ð .r   r   c                   óZ   — e Zd ZU dZdZej                  d   ed<   	 	 	 d	defd„Z	d„ Z
d„ Zy)
ÚgraphaÅ  Context-manager that captures CUDA work into a :class:`torch.cuda.CUDAGraph` object for later replay.

    See :ref:`CUDA Graphs <cuda-graph-semantics>` for a general introduction,
    detailed use, and constraints.

    Arguments:
        cuda_graph (torch.cuda.CUDAGraph): Graph object used for capture.
        pool (optional): Opaque token (returned by a call to :func:`~torch.cuda.graph_pool_handle()` or
            :meth:`other_Graph_instance.pool()<torch.cuda.CUDAGraph.pool>`) hinting this graph's capture
            may share memory from the specified pool. See :ref:`Graph memory management<graph-memory-management>`.
        stream (torch.cuda.Stream, optional): If supplied, will be set as the current stream in the context.
            If not supplied, ``graph`` sets its own internal side stream as the current stream in the context.
        capture_error_mode (str, optional): specifies the cudaStreamCaptureMode for the graph capture stream.
            Can be "global", "thread_local" or "relaxed". During cuda graph capture, some actions, such as cudaMalloc,
            may be unsafe. "global" will error on actions in other threads, "thread_local" will only error for
            actions in the current thread, and "relaxed" will not error on actions. Do NOT change this setting
            unless you're familiar with `cudaStreamCaptureMode <https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85>`_

    .. note::
        For effective memory sharing, if you pass a ``pool`` used by a previous capture and the previous capture
        used an explicit ``stream`` argument, you should pass the same ``stream`` argument to this capture.

    .. warning::
        This API is in beta and may change in future releases.

    .. _cudaStreamCaptureMode:
        https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85
    Nztorch.cuda.StreamÚdefault_capture_streamr   c                 ót  — | j                   j                  €-t        j                  j	                  «       | j                   _        |€dn|f| _        |�|n| j                   j                  | _        | j                  €J ‚t        j                  j                  | j                  «      | _        || _	        || _
        y )Nr
   )r   r2   ÚtorchÚcudaÚStreamr   Úcapture_streamÚstreamÚ
stream_ctxÚ
cuda_graphr   )r   r:   r   r8   r   s        r   Ú__init__zgraph.__init__•   s—   € ð �>‰>×0Ñ0Ð8Ü49·J±J×4EÑ4EÓ4GˆD�N‰NÔ1à˜,‘B¨T¨GˆŒ	àÐ(‰F¨d¯n©n×.SÑ.Sð 	Ôð ×"Ñ"Ð.Ð.Ð.ÜŸ*™*×+Ñ+¨D×,?Ñ,?Ó@ˆŒØ$ˆŒØ"4ˆÕr   c                 ó8  — t         j                  j                  «        t        j                  «        t         j                  j                  «        | j                  j                  «         | j                  j                  | j                  d| j                  iŽ y )Nr   )r4   r5   ÚsynchronizeÚgcÚcollectÚempty_cacher9   Ú	__enter__r:   r   r   r   )r   s    r   rA   zgraph.__enter__«   sf   € ä�
‰
×ÑÔ Ü
�
‰
ŒÜ�
‰
×ÑÔ ð 	�‰×!Ñ!Ô#à%ˆ�‰×%Ñ%Ø�Y‰Yð	
Ø+/×+BÑ+Bó	
r   c                 ór   — | j                   j                  «        | j                  j                  |||«       y r   )r:   r   r9   Ú__exit__)r   Úexc_typeÚ	exc_valueÚ	tracebacks       r   rC   zgraph.__exit__¹   s(   € Ø�‰×#Ñ#Ô%Ø�‰× Ñ  ¨9°iÕ@r   )NNr*   )r+   r,   r-   r.   r2   ÚtypingÚOptionalÚ__annotations__Ústrr;   rA   rC   r
   r   r   r1   r1   u   sE   … ñð: DHÐ˜FŸO™OÐ,?Ñ@ÓGð
 ØØ"*ñ5ð
  ó5ò,
óAr   r1   c                 ó†  — t        j                  «       rt        j                  «       rt        d«      ‚d}t	        | t
        «      sd}| f} |f}g }t        | |«      D ]ø  \  }}t	        |t         j                  j                  «      rvt        |j                  «      dk(  r0t        |j                  «      dk(  rt        |j                  «      dk(  sJ d«       ‚t        d„ |j                  «       D «       «      sJ d«       ‚t        j                  j                   j"                  |Ž }	|j%                  t        |	«      «       t        d„ |	D «       «      rŒóJ d	«       ‚ |D �cg c]  }t        |«      ‘Œ }
}| D �cg c]A  }t	        |t         j                  j                  «      rt        |j'                  «       «      nd
‘ŒC }}t)        t        | «      «      D �cg c]  }||   ||   z   ‘Œ }}t)        t        | «      «      D �cg c]   }t         j*                  j-                  «       ‘Œ" }}t)        t        | «      «      D �cg c]   }t         j*                  j-                  «       ‘Œ" }}|€
t/        «       n|}t         j*                  j1                  «        t         j*                  j3                  t         j*                  j5                  «       «      5  t        | ||«      D ]¸  \  }}}d\  }}}t)        |«      D ]“  }t         j                  j                   j7                   ||Ž «      }t        d„ |D «       «      }t        |«      dkD  sŒPt         j8                  j;                  |t        d„ |D «       «      t        d„ |D «       «      d|¬«      }Œ• |||fD ]  }~Œ Œº 	 ddd«       t         j*                  j1                  «        g }g }t        | ||«      D ]Œ  \  }}}t         j*                  j=                  ||¬«      5   ||Ž }ddd«       t         j                  j                   j?                  «      \  }}|j%                  t        |«      «       |j%                  |«       ŒŽ g }g }t        tA        |«      tA        |«      tA        |«      «      D �]  \  }}} t        d„ |D «       «      }!t        d„ |D «       «      }d}t        |«      dkD  rnt         j*                  j=                  | |¬«      5  t         j8                  j;                  |t        d„ |D «       «      t        d„ |!D «       «      d|¬«      }ddd«       g }"d}#|D ];  }$|$jB                  r|�|"j%                  ||#   «       |#dz  }#Œ+|"j%                  d«       Œ= t        |"«      }"|j%                  |!«       |j%                  |"«       �Œ |jE                  «        |jE                  «        d„ }%g }&tG        | «      D ]ž  \  }} |%||   ||   ||   |
|   ||   ||   ||   ||   ||   «	      }'t	        |t         j                  j                  «      r9d„ }( |(||jH                  |'|jJ                  «      |_%        |&j%                  |«       ŒŽ|&j%                  |'«       Œ  |r|&d   S t        |&«      S c c}w c c}w c c}w c c}w c c}w # 1 sw Y   �ŒxY w# 1 sw Y   �Œ¶xY w# 1 sw Y   �Œ”xY w)aØ  Accept callables (functions or :class:`nn.Module<torch.nn.Module>`\ s) and returns graphed versions.

    Each graphed callable's forward pass runs its source callable's
    forward CUDA work as a CUDA graph inside a single autograd node.

    The graphed callable's forward pass also appends
    a backward node to the autograd graph. During backward, this node runs the
    callable's backward work as a CUDA graph.

    Therefore, each graphed callable should be a drop-in replacement for its source callable
    in an autograd-enabled training loop.

    See :ref:`Partial-network capture<partial-network-capture>` for detailed use and constraints.

    If you pass a tuple of several callables, their captures will use the same memory pool.
    See :ref:`Graph memory management<graph-memory-management>` for when this is appropriate.

    Arguments:
        callables (torch.nn.Module or Python function, or tuple of these): Callable or callables to graph.
            See :ref:`Graph memory management<graph-memory-management>` for when passing a tuple of callables
            is appropriate.  If you pass a tuple of callables, their order in the tuple must be the same order
            they'll run in the live workload.
        sample_args (tuple of Tensors, or tuple of tuples of Tensors): Samples args for each callable.
            If a single callable was passed, ``sample_args`` must be a single tuple of argument Tensors.
            If a tuple of callables was passed, ``sample_args`` must be tuple of tuples of argument Tensors.
        num_warmup_iters (int): The number of warmup iterations. Currently, ``DataDistributedParallel`` needs
            11 iterations for warm up. Default: ``3``.
        allow_unused_input (bool): If False, specifying inputs that were not used when computing outputs
            (and therefore their grad is always zero) is an error. Defaults to False.
        pool (optional): Token (returned by :func:`~torch.cuda.graph_pool_handle` or
            :meth:`other_Graph_instance.pool()<torch.cuda.CUDAGraph.pool>`) that hints this graph may share memory
            with the indicated pool.  See :ref:`Graph memory management<graph-memory-management>`.
    .. note::
        The ``requires_grad`` state of each Tensor in ``sample_args`` must match the state
        that's expected for the corresponding real input in the training loop.

    .. warning::
        This API is in beta and may change in future releases.

    .. warning::
        ``sample_args`` for each callable must contain only Tensors. Other types are not allowed.

    .. warning::
        Returned callables do not support higher order differentiation (e.g., double backward).

    .. warning::
        In any :class:`~torch.nn.Module` passed to :func:`~make_graphed_callables`, only parameters
        may be trainable. Buffers must have ``requires_grad=False``.

    .. warning::
        After you pass a :class:`torch.nn.Module` through :func:`~make_graphed_callables`,
        you may not add or remove any of that Module's parameters or buffers.

    .. warning::
        :class:`torch.nn.Module`\s passed to :func:`~torch.cuda.make_graphed_callables` must not have module hooks
        registered on them at the time they are passed. However, registering hooks on modules *after* passing them
        through :func:`~torch.cuda.make_graphed_callables` is allowed.

    .. warning::
        When running a graphed callable, you must pass its arguments in the same order and format
        they appeared in that callable's ``sample_args``.

    .. warning::
        The automatic mixed precision is supported in :func:`~torch.cuda.make_graphed_callables` only with disabled
        caching. The context manager `torch.cuda.amp.autocast()` must have `cache_enabled=False`.
    z_make_graphed_callables does not support the autocast caching. Please set `cache_enabled=False`.FTr   z§Modules must not have hooks registered at the time they are passed. However, registering hooks on modules after passing them through make_graphed_callables is allowed.c              3   ó8   K  — | ]  }|j                   d u –— Œ y­w)FN©Úrequires_grad©Ú.0Úbs     r   ú	<genexpr>z)make_graphed_callables.<locals>.<genexpr>  s   è ø€ ÒE°A�q—‘¨%Ô/ÑEùs   ‚zœIn any :class:`~torch.nn.Module` passed to :func:`~make_graphed_callables`, only parameters may be trainable. All buffers must have ``requires_grad=False``.c              3   óP   K  — | ]  }t        |t        j                  «      –— Œ  y ­wr   )Ú
isinstancer4   ÚTensor)rP   Úargs     r   rR   z)make_graphed_callables.<locals>.<genexpr>#  s   è ø€ ÒH°S”:˜c¤5§<¡<×0ÑHùs   ‚$&zfIn the beta API, sample_args for each callable must contain only Tensors. Other types are not allowed.r
   N)NNNc              3   ó:   K  — | ]  }|j                   sŒ|–— Œ y ­wr   rM   ©rP   Úos     r   rR   z)make_graphed_callables.<locals>.<genexpr>D  s   è ø€ Ò$K¨1¸1¿?»?¤QÑ$Kùó   ‚”c              3   ó:   K  — | ]  }|j                   sŒ|–— Œ y ­wr   rM   ©rP   Úis     r   rR   z)make_graphed_callables.<locals>.<genexpr>H  s   è ø€ ò %Ø"#¸q¿»œAñ%ùrZ   c              3   ó`   K  — | ]&  }|j                   sŒt        j                  |«      –— Œ( y ­wr   ©rN   r4   Ú
empty_likerX   s     r   rR   z)make_graphed_callables.<locals>.<genexpr>K  s&   è ø€ ò +Ø45ÀAÇOÃOœE×,Ñ,¨Q×/ñ+ùs   ‚.”.)ÚoutputsÚinputsÚgrad_outputsÚonly_inputsÚallow_unused)r   c              3   ób   K  — | ]'  }|j                   rt        j                  |«      nd –— Œ) y ­wr   r_   rX   s     r   rR   z)make_graphed_callables.<locals>.<genexpr>o  s+   è ø€ ò $
ØAB 1§?¢?ŒE×Ñ˜QÔ¸Ó<ñ$
ùs   ‚-/c              3   ó:   K  — | ]  }|j                   sŒ|–— Œ y ­wr   rM   rX   s     r   rR   z)make_graphed_callables.<locals>.<genexpr>s  s   è ø€ ÒJ 1¸!¿/»/œQÑJùrZ   c              3   ó:   K  — | ]  }|j                   sŒ|–— Œ y ­wr   rM   r\   s     r   rR   z)make_graphed_callables.<locals>.<genexpr>y  s   è ø€ Ò T qÀAÇOÃO¤Ñ TùrZ   c              3   ó&   K  — | ]	  }|€Œ|–— Œ y ­wr   r
   rX   s     r   rR   z)make_graphed_callables.<locals>.<genexpr>z  s   è ø€ Ò&W¨QÈÉ¤qÑ&Wùs   ‚Šé   c	           	      ó~   ‡ ‡‡‡‡‡‡‡‡‡
—  G ˆˆ ˆˆˆˆˆfd„dt         j                  j                  «      Š
ˆ
ˆˆfd„}	|	S )Nc                   ó†   •— e Zd Zeˆˆˆˆfd„«       Zeej                  j                  j                  ˆ ˆˆfd„«       «       Z	y)úOmake_graphed_callables.<locals>.make_graphed_autograd_function.<locals>.Graphedc                 ó
  •— t        ‰«      D ]A  }‰|   j                  «       ||   j                  «       k7  sŒ+‰|   j                  ||   «       ŒC ‰j                  «        t	        ‰t
        «      sJ ‚t        d„ ‰D «       «      S )Nc              3   ó<   K  — | ]  }|j                  «       –— Œ y ­wr   ©ÚdetachrX   s     r   rR   zjmake_graphed_callables.<locals>.make_graphed_autograd_function.<locals>.Graphed.forward.<locals>.<genexpr>¨  s   è ø€ Ò@¨A˜QŸX™XŸZÑ@ùs   ‚)ÚrangeÚdata_ptrÚcopy_r!   rT   Útuple)Úctxrb   r]   Ú	fwd_graphÚlen_user_argsÚstatic_input_surfaceÚstatic_outputss      €€€€r   ÚforwardzWmake_graphed_callables.<locals>.make_graphed_autograd_function.<locals>.Graphed.forward   s„   ø€ ô ˜}Ó-ò A�AØ+¨AÑ.×7Ñ7Ó9¸VÀA¹Y×=OÑ=OÓ=QÓQØ,¨QÑ/×5Ñ5°f¸Q±iÕ@ðAð × Ñ Ô"Ü! .´%Ô8Ð8Ð8ÜÑ@°Ô@Ó@Ð@r   c                 ó2  •— t        |«      t        ‰«      k(  sJ ‚t        ‰|«      D ];  \  }}|€Œ	|j                  «       |j                  «       k7  sŒ+|j                  |«       Œ= ‰j	                  «        t        ‰t        «      sJ ‚t        d„ ‰D «       «      S )Nc              3   óD   K  — | ]  }|�|j                  «       n|–— Œ y ­wr   rp   rO   s     r   rR   zkmake_graphed_callables.<locals>.make_graphed_autograd_function.<locals>.Graphed.backward.<locals>.<genexpr>¸  s$   è ø€ ò Ø;< ! -�A—H‘H”J°QÓ6ñùs   ‚ )ÚlenÚziprs   rt   r!   rT   ru   )rv   ÚgradsÚgÚgradÚ	bwd_graphÚstatic_grad_inputsÚstatic_grad_outputss       €€€r   ÚbackwardzXmake_graphed_callables.<locals>.make_graphed_autograd_function.<locals>.Graphed.backwardª  s™   ø€ ô ˜5“z¤SÐ)<Ó%=Ò=Ð=Ð=Ü"Ð#6¸Ó>ò *‘G�A�tØ‘}ð Ÿ:™:›<¨4¯=©=«?Ó:ØŸG™G D�Mð*ð × Ñ Ô"ô "Ð"4´eÔ<Ð<Ð<Üñ Ø@Rôó ð r   N)
r+   r,   r-   Ústaticmethodr{   r4   ÚautogradÚfunctionÚonce_differentiabler†   )rƒ   rw   rx   r„   r…   ry   rz   s   €€€€€€€r   ÚGraphedrm   Ÿ  sC   ø„ ØöAó ðAð Ø�^‰^×$Ñ$×8Ñ8õó 9ó ñr   r‹   c                  óÚ   •— t        j                  j                  j                  | Ž } ‰j                  t        |«      ‰z   Ž }t         j                  j                  j                  |‰«      S r   )r4   ÚutilsÚ_pytreeÚarg_tree_leavesÚapplyru   Útree_unflatten)Ú	user_argsÚflatten_user_argsÚoutr‹   Úmodule_paramsÚoutput_unflatten_specs      €€€r   ÚfunctionalizedzVmake_graphed_callables.<locals>.make_graphed_autograd_function.<locals>.functionalized¼  sY   ø€ ô !&§¡× 3Ñ 3× CÑ CÀYÐ OÐØ�'—-‘-¤%Ð(9Ó":¸]Ñ"JÐLˆCÜ—;‘;×&Ñ&×5Ñ5°cÐ;PÓQÐQr   )r4   rˆ   ÚFunction)rw   rƒ   r•   rx   r–   ry   rz   r…   r„   r—   r‹   s   ````````` @r   Úmake_graphed_autograd_functionz>make_graphed_callables.<locals>.make_graphed_autograd_function”  s-   ÿù€ ÷	ô 	”e—n‘n×-Ñ-ô 	ö:	Rð Ðr   c                 ó   ‡ ‡‡‡— ˆ ˆˆˆfd„}|S )Nc                  ó6   •— ‰j                   ‰k(  r ‰| Ž S  ‰| Ž S r   )Útraining)r’   ÚfuncÚgraph_training_stateÚgraphedÚorig_fwds    €€€€r   Únew_fwdzEmake_graphed_callables.<locals>.make_graphed_forward.<locals>.new_fwdØ  s(   ø€ ð —}‘}Ð(<Ò<Ù&¨	Ð2Ð2á'¨Ð3Ð3r   r
   )r�   rž   rŸ   r    r¡   s   ```` r   Úmake_graphed_forwardz4make_graphed_callables.<locals>.make_graphed_forward×  s   û€ ÷4ð �r   )&r4   Úis_autocast_enabledÚis_autocast_cache_enabledÚRuntimeErrorrT   ru   r   ÚnnÚModuler~   Ú_backward_hooksÚ_forward_hooksÚ_forward_pre_hooksÚallÚbuffersr�   rŽ   r�   ÚappendÚ
parametersrr   r5   r   r   r=   r8   r6   Útree_leavesrˆ   r‚   r1   Útree_flattenÚreversedrN   ÚreverseÚ	enumeraterœ   r{   ))Ú	callablesÚsample_argsÚnum_warmup_itersÚallow_unused_inputr   Újust_one_callableÚflatten_sample_argsÚcÚargsÚflatten_argÚper_callable_len_user_argsÚper_callable_module_paramsr]   Ú"per_callable_static_input_surfacesÚ_Ú
fwd_graphsÚ
bwd_graphsÚmempoolr�   ry   Úgrad_inputsra   Úoutputs_gradÚvÚper_callable_static_outputsÚ"per_callable_output_unflatten_specrw   Úflatten_outputsÚspecÚ per_callable_static_grad_outputsÚper_callable_static_grad_inputsrz   rƒ   r…   r„   Úgrad_idxrV   r™   ÚretrŸ   r¢   s)                                            r   Úmake_graphed_callablesrÏ   ¿   s­  € ôJ × Ñ Ô"¤u×'FÑ'FÔ'HÜØmó
ð 	
ð Ðä�i¤Ô'Ø ÐØ�Lˆ	Ø"�nˆàÐä�y +Ó.ò 
‰ˆˆ4Ü�aœŸ™Ÿ™Ô)ä�A×%Ñ%Ó&¨!Ò+Ü˜×(Ñ(Ó)¨QÒ.Ü˜×,Ñ,Ó-°Ò2ðð
]óð3ô ÑE¸¿¹»ÔEÔEð ð-óÐEô
 —k‘k×)Ñ)×9Ñ9¸4Ð@ˆØ×"Ñ"¤5¨Ó#5Ô6ÜÑH¸KÔHÕHð 	
ðZó	
ÐHð#
ð0 9LÖ!L°¤# d¥)Ð!LÐÐ!Lð ö"àô ",¨A¬u¯x©x¯©Ô!?Œˆa�l‰l‹nÔÀRÑGð"Ðð "ô ”s˜9“~Ó&ö*àð 	˜AÑÐ!;¸AÑ!>Ó>ð*Ð&ð *ô
 38¼¸I»Ó2GÖH¨Q”%—*‘*×&Ñ&Õ(ÐH€JÐHÜ27¼¸I»Ó2GÖH¨Q”%—*‘*×&Ñ&Õ(ÐH€JÐHà%) \ÔÔ!°t€Gô
 
‡J�J×ÑÔÜ	�‰×	Ñ	œ5Ÿ:™:×,Ñ,Ó.Ó	/ñ Ü03Ø�{Ð$Fó1
ò 	Ñ,ˆD�$Ð,ð 2BÑ.ˆK˜ ,ÜÐ+Ó,ò �ÜŸ+™+×-Ñ-×9Ñ9¹$À¸+ÓF�Ü$Ñ$K°Ô$KÓK�Ü�|Ó$ qÓ(Ü"'§.¡.×"5Ñ"5Ø ,Ü$ñ %Ø';ô%ó  ô &+ñ +Ø9@ô+ó &ð %)Ø%7ð #6ó 
#‘Kð	ð ˜|¨[Ð9ò �Ùññ'	÷ô. 
‡J�J×ÑÔð #%ÐØ)+Ð&Ü!$ Y°¸ZÓ!Hò 8Ñˆˆd�IÜ�Z‰Z×Ñ˜i¨gÐÓ6ñ 	"Ù˜D�kˆG÷	"ô !&§¡× 3Ñ 3× @Ñ @ÀÓ IÑˆ˜Ø#×*Ñ*¬5°Ó+AÔBØ*×1Ñ1°$Õ7ð8ð (*Ð$Ø&(Ð#Ü;>ÜÐ3Ó4ÜÐ,Ó-Ü�Óó<ó %CÑ7Ð˜n¨iô $ñ $
ØFTô$
ó 
Ðô ÑJ¨ÔJÓJˆØˆÜˆ|Ó˜qÒ Ü—‘×!Ñ! )°'Ð!Ó:ñ Ü#Ÿn™n×1Ñ1Ø(Ü Ñ TÐ,@Ô TÓTÜ!&Ñ&WÐ2EÔ&WÓ!WØ $Ø!3ð 2ó �÷ð  ÐØˆØ'ò 	0ˆCØ× Ò  [Ð%<Ø"×)Ñ)¨+°hÑ*?Ô@Ø˜A‘‘à"×)Ñ)¨$Õ/ð	0ô #Ð#5Ó6Ðà(×/Ñ/Ð0CÔDØ'×.Ñ.Ð/AÖBðK%CðP %×,Ñ,Ô.Ø#×+Ñ+Ô-ò0ðf €CÜ˜YÓ'ò  ‰ˆˆ4Ù0Ø�q‰MØ�q‰MØ& qÑ)Ø& qÑ)Ø.¨qÑ1Ø.¨qÑ1Ø'¨Ñ*Ø,¨QÑ/Ø+¨AÑ.ó

ˆô �dœEŸH™HŸO™OÔ,ò	ñ 0°°d·m±mÀWÈdÏlÉlÓ[ˆDŒLØ�J‰J�tÕà�J‰J�wÕð; ñ> Ø�1‰vˆä�‹:ÐùòA "Mùò"ùò*ùò
 IùÚH÷ñ ú÷B	"ñ 	"ú÷0ñ úsL   ÅZÅ3AZÇZÇ;%ZÈ8%ZËA5ZÌ<AZÏ/Z)ÓAZ6ÚZ&Ú)Z3	Ú6[ 	)é   FN)r>   rG   r4   Ú_utilsr   ÚhasattrÚ_CÚ__dict__Útorch._Cr   r   r   r   r   r   r1   rÏ   r
   r   r   ú<module>rÖ      s¼   ðã 	Û ã å  ñ ˆu�x‰xÐ*Ô+á&1°,Ó&?€E‡H�H×Ñ�lÑ#Ù.9Ð:NÓ.O€E‡H�H×ÑÐ*Ñ+Ù:EØ(ó;€E‡H�H×ÑÐ6Ñ7÷ñ ò,ò ôD.�—‘×#Ñ#ô D.÷NFAñ FAðV PTôkr   