
    ȅi                         S SK Jr  S SKJr  S SKJrJrJr  S SKJ	r	  S SK
Jr  S SKJr  SSKJr  SS	KJr  SS
KJr  SSKJr  \(       a  S SKJr  S SKJr  / SQr " S S\5      rg)    )Sequence)getattr_static)AnyTYPE_CHECKING	TypeGuard)Source
SDPAParams)Proxy   )create_call_function)unimplemented)
AttrSource   )VariableTracker)	PyCodegen)InstructionTranslator)querykeyvalue	attn_maskdropout	is_causal
enable_gqac            	          ^  \ rS rSrSr\SSS\S\S\4S j5       r	S	\
S
\\   S\SS4U 4S jjrSS jrS\
4S jrSSS\S\4S jr\S\S\S   4S j5       rSrU =r$ )SDPAParamsVariable   zaRepresents the c++ params struct for scaled dot product attention.
This is a read-only container.txr   r   sourcereturnc                     SSK Jn  [         Vs/ s H-  n[        R                  " U [        X5      [        X$5      5      PM/     nnU" [        5      R                  X0 5      $ s  snf )Nr   )TorchInGraphFunctionVariable)	torchr"   PARAM_NAMESr   buildgetattrr   r
   call_function)r   r   r   r"   pparamss         V/home/james-whalen/.local/lib/python3.13/site-packages/torch/_dynamo/variables/sdpa.pycreateSDPAParamsVariable.create"   sb     	8 !
  !!"ge&7F9NO  	 
 ,J7EEbRTUU	
s   4A!proxy
param_varskwargsNc                 >   > Xl         X l        [        TU ]  " S0 UD6  g )N )r-   r.   super__init__)selfr-   r.   r/   	__class__s       r*   r3   SDPAParamsVariable.__init__.   s     
$"6"    c                    ^ U R                   b   eU R                  c   eTR                  U4S j5        TR                  U R                  5        TR	                  [        [        U R                  5      S5      5        g )Nc                  (   > T R                  SS5      $ )Nztorch._C_SDPAParams)load_import_from)codegens   r*   <lambda>0SDPAParamsVariable.reconstruct.<locals>.<lambda>9   s    G,,ZGr7   F)r   r.   add_push_nullforeachextend_outputr   len)r4   r<   s    `r*   reconstructSDPAParamsVariable.reconstruct5   se    {{"""***G	
 	(23t3GOPr7   c                     U R                   $ N)r-   )r4   s    r*   as_proxySDPAParamsVariable.as_proxy>   s    zzr7   namec                 p   SS K nSSKJn  SSKJn   [        UR                  R                  U5        UR                  U R                  5       U5      nU R                   b  U" X[#        U R                   U5      S
9$ U" XS9$ ! [         a+    SS K	J
s  Jn  [        SSU 3SU S3/ UR                  QS	9   Nf = f)Nr   r   )wrap_fx_proxy)GetAttrVariablez*unsupported torch._C._SDPAParams attributezname: zUnable to fetch attribute z from torch._C._SDPAParams.)gb_typecontextexplanationhints)r   r-   r   )r   r-   )torch._CbuilderrK   miscrL   r   _Cr:   AttributeErrortorch._dynamo.graph_break_hints_dynamograph_break_hintsr   
USER_ERRORcreate_getattr_proxyrG   r   r   )r4   r   rI   r#   rK   rL   rX   r-   s           r*   var_getattrSDPAParamsVariable.var_getattrA   s    *)	588//6  44T]]_dK;;" :dkk4+H  !B44%  
	GGD 8>YZ&11	
	s    B   2B54B5r
   c                     U [         L $ rF   r	   )r   s    r*   is_sdpa_params!SDPAParamsVariable.is_sdpa_params]   s    
""r7   )r.   r-   )r<   r   r    N)__name__
__module____qualname____firstlineno____doc__staticmethodr   r   r   r+   r   r   r3   rC   rG   strr[   r   r^   __static_attributes____classcell__)r5   s   @r*   r   r      s    & 	V#	V,/	V9?	V		V 	V##(0(A#MP#	#Q% 55 5S 5_ 58 #c #i&= # #r7   r   N)collections.abcr   inspectr   typingr   r   r   torch._guardsr   torch.backends.cudar
   torch.fx.proxyr   bytecode_transformationr   excr   r   r   baser   torch._dynamo.codegenr   torch._dynamo.symbolic_convertr   r$   r   r1   r7   r*   <module>rt      sF    $ " 0 0   *   :   ! /DA# A#r7   