
    VhD                     6   d Z ddlZddlmZmZmZmZmZmZ ddl	m
Z
  ed      Z e
d      Ze	 ddeeef   ded	eeef   fd
       Ze	 dded   ded	eeeef   geeef   f   fd       Z	 ddeeeef      ded	eeeef   eeeef   geeef   f   f   fdZy)za
APIs related to torch.compile which lazily import torch._dynamo to avoid
circular dependencies.
    N)CallableLiteralOptionaloverloadTypeVarUnion)	ParamSpec_T_Pfn	recursivereturnc                      y N r   r   s     >/home/dcms/DCMS/lib/python3.12/site-packages/torch/_compile.py_disable_dynamor      s         c                      y r   r   r   s     r   r   r      s     69r   c                       Gt        j                         dt        j                  dt        j                  dt
        f fd       }|S t        j                  t              S )au  
    This API should be only used inside torch, external users should still use
    torch._dynamo.disable. The main goal of this API is to avoid circular
    imports issues that is common while using _dynamo.disable inside torch
    itself.

    This API avoids it by lazily importing torch._dynamo from the import time to
    the invocation of the decorated function.
    argskwargsr   c                      t        dd       }|'dd l}|j                  j                        }|_         || i |S )N__dynamo_disabler   )getattrtorch._dynamo_dynamodisabler   )r   r   
disable_fntorchr   r   s       r   innerz_disable_dynamo.<locals>.inner)   sK     !%7>J!$"]]222yA
&0#t.v..r   )r   )	functoolswrapsr   r   r   r
   partialr   )r   r   r"   s   `` r   r   r      s^     
~				/ 		/BII 		/" 		/ 
		/    IFFr   )T)NT)__doc__r#   typingr   r   r   r   r   r   typing_extensionsr	   r
   r   boolr   r   r   r   <module>r*      s&  
  H H ' T]t_ 
,0R%)b"f 

 
0499)-9xB (2r6"2239 
9 >BG"b&!"G6:G
8BFXxB'7&8(2r6:J&JKKLGr   