+
    &j                       ^ RI Ht ^ RIt^ RIHt ^ RIHtHt ^ RIH	t	 ^ RI
Ht ^ RIHtHtHtHt ^ RIHtHtHtHtHtHtHtHt ^ R	IHt ]'       d   ^ R
IHt ]! RR7       ! R R4      4       t]! RR7       ! R R4      4       t]! RR7       ! R R4      4       t ]! RR7       ! R R4      4       t!R R lt"R R lt#R R lt$]! RR7       ! R R4      4       t%]! RR7       ! R R4      4       t&]! RR7       ! R R 4      4       t'R! R" lt(R# R$ lt)R%0t*0 R0mt+0 R1mt,R& R' lt-R2R( R) llt.R* R+ lt/R, R- lt0R2R. R/ llt1R# )3    )annotationsN)	dataclass)castTYPE_CHECKING)local)cpp)	BaseCTypeBinding
NamedCTypetensorListT)BaseTyBaseTypeFunctionSchemaListTypeNativeFunctionNativeFunctionsViewGroup
SchemaKindType)IDENT_REGEX)SequenceT)frozenc                  ,    ] tR t^t$ R]R&   R]R&   RtR# )SavedAttributer   nctypestrexpr N__name__
__module____qualname____firstlineno____annotations____static_attributes__r       m/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torchgen/api/autograd.pyr   r      s      Ir%   r   c                  T    ] tR t^+t$ R]R&   R]R&   R]R&   R]R&   R]R&   R	]R
&   RtR# )
Derivativer   formulaoriginal_formulatuple[str, ...]	var_namesztuple[SavedAttribute, ...]saved_inputssaved_outputsset[str]named_gradientsr   Nr   r   r%   r&   r(   r(   +   s1     L   -, .- r%   r(   c                  ^    ] tR t^Gt$ R]R&   R]R&   R]R&   R]R&   R]R	&   R
]R&   R
]R&   RtR# )ForwardDerivativer   r)   r+   r,   ztuple[Type, ...]	var_typesztuple[str, ...] | Nonerequired_inputs_fw_gradrequired_inputs_primalboolrequired_original_self_valueis_reusing_outplace_formular   Nr   r   r%   r&   r2   r2   G   s9    
 L    43 32 #'& "&%r%   r2   c                      ] tR t^ft$ R]R&   R]R&   R]R&   R]R&   R	]R
&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   ]R R l4       tR R ltRtR# )DifferentiabilityInfor   namer   funcz
str | NoneopzSequence[Derivative]derivativeszSequence[ForwardDerivative]forward_derivativeszSequence[SavedAttribute]all_saved_inputsall_saved_outputszSequence[str]available_named_gradientsr/   used_named_gradientszSequence[Binding]args_with_derivativesnon_differentiable_arg_nameszlist[bool] | Noneoutput_differentiabilityzlist[str] | None#output_differentiability_conditionsc                   V ^8  d   QhRR/# )   returnr6   r   )formats   "r&   __annotate__"DifferentiabilityInfo.__annotate__   s     3 3 3r%   c                	2    \        V P                  4      ^ 8  # )r   )lenrD   selfs   &r&   has_derivatives%DifferentiabilityInfo.has_derivatives   s    4--.22r%   c                    V ^8  d   QhRRRR/# )rI   gr   rJ   DifferentiabilityInfo | Noner   )rK   s   "r&   rL   rM      s     
 
)
	%
r%   c                	   VP                   f   R # VP                   pV P                  P                  R^R7      pV^ ,           R2RP                  VR,          4      ,           pV P                  f   R MV P                   R2p\        VVVV P                  V P                  V P                  V P                  V P                  V P                  V P                  V P                  V P                  V P                  R7      # )N.)maxsplitz_copy.:   NN_copyr;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   )	view_copyr;   splitjoinr=   r:   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   )rQ   rU   fname_split_by_periodview_copy_nameview_copy_op_names   &&    r&   %create_view_copy_from_view_derivative;DifferentiabilityInfo.create_view_copy_from_view_derivative   s     ;;KK#yysQ?034F;chh $?
 
 %)GGODDGG9E9J$ (( $ 8 8!22"44&*&D&D!%!:!:"&"<"<)-)J)J%)%B%B040X0X
 	
r%   r   N)	r   r    r!   r"   r#   propertyrR   rd   r$   r   r%   r&   r:   r:   f   s     I 
 	N &% 54 /. 0/  -, #"
 -, #0/ 0/ *:93 3
 
r%   r:   c               $    V ^8  d   QhRRRRRR/# )rI   inforV   identr   rJ   r6   r   )rK   s   "r&   rL   rL      s"      1 # $ r%   c                    V f   R# V P                    FC  pVP                  p\        P                  ! \        P
                  ! V4      V4      '       g   KB   R# 	  R# )NFT)r>   r)   researchr   rK   )rh   ri   
derivativer)   s   &&  r&   
uses_identrn      sI    |&&
$$99[''.88 ' r%   c                    V ^8  d   QhRRRR/# rI   rh   rV   rJ   r6   r   )rK   s   "r&   rL   rL      s     0 0 < 0 0r%   c                    \        V R 4      # )retain_variablesrn   rh   s   &r&   uses_retain_variablesru      s    d.//r%   c                    V ^8  d   QhRRRR/# rp   r   )rK   s   "r&   rL   rL      s     $ $7 $D $r%   c                    \        V R 4      # )gradrs   rt   s   &r&   uses_single_gradry      s    dF##r%   c                  6    ] tR t^t$ R]R&   R]R&   R]R&   RtR# )DifferentiableInputr   r;   r   typecpp_typer   Nr   r   r%   r&   r{   r{          
I
J Mr%   r{   c                  6    ] tR t^t$ R]R&   R]R&   R]R&   RtR# )DifferentiableOutputr   r;   r   r|   r}   r   Nr   r   r%   r&   r   r      r~   r%   r   c                  6    ] tR tRt$ R]R&   R]R&   R]R&   RtR	# )
'NativeFunctionWithDifferentiabilityInfoi  r   r<   z'dict[str, DifferentiabilityInfo] | Nonerh   z-dict[str, Sequence[ForwardDerivative]] | Nonefw_derivativesr   Nr   r   r%   r&   r   r     s    

11AAr%   r   c                    V ^8  d   QhRRRR/# )rI   fnr   rJ   r   r   )rK   s   "r&   rL   rL     s     . .A .c .r%   c                2   V P                   P                  '       gy   V P                  em   \        ;QJ d4    R V P                  P	                  4        4       F  '       g   K   RM)	  RM%! R V P                  P	                  4        4       4      '       d   R# R# )a  How are we going to call the underlying implementation of a
declaration?  There are two strategies:
    - use_derived: we want to call the implementation on CPUDoubleType
      (or a similar, derived Type instance).  Because these derived
      instances deal in Tensors, not Variables (it's a completely different
      object, so it doesn't dispatch back to VariableType), code on
      this dispatch path needs to wrap/unwrap tensors.  If the
      derived implementation takes and returns tensors, the
      implementation is usually differentiable (although we also use
      the derived dispatch path for non-differentiable functions
      that we still want to dispatch on the derived Type instance;
      e.g., size())
    - use_type: we want to call the implementation on Type, because
      it is implemented concretely, and the functions it invokes will
      get dispatched back to VariableType (which will ensure that they
      are differentiable.)
c              3  8   "   T F  qP                   x  K  	  R # 5iN)rR   .0rh   s   & r&   	<genexpr>$dispatch_strategy.<locals>.<genexpr>"  s     #VEUT$8$8EUs   TFuse_deriveduse_type)r<   is_abstractrh   anyvalues)r   s   &r&   dispatch_strategyr     s^    , 
ww
#VRWW^^EU#V#VRWW^^EU#V V V"  r%   c                    V ^8  d   QhRRRR/# )rI   r`   r   rJ   r6   r   )rK   s   "r&   rL   rL   <  s     9 9~ 9$ 9r%   c                t    V P                   P                  P                  P                  P                  R 4      # )	_foreach_)r<   r;   base
startswith)r`   s   &r&   is_foreach_funcr   <  s'    66;;  ++K88r%   _foreach_zero_c               $    V ^8  d   QhRRRRRR/# )rI   r`   r   function_schemar   rJ   r6   r   )rK   s   "r&   rL   rL   X  s&      # 
r%   c                   V P                   P                  P                  P                  P                  R 4      R,          VP                  P                  P                  8H  ;'       Ed    VP                  P                  P                  '       * ;'       g0    \        V P                   P                  4      \        9   ;'       Ed,    \        V P                   P                  4      \        9   ;'       gR    \        V P                   P                  P                  4      \        VP                  P                  4      8H  ;'       d    \        ;QJ dX    R \        V P                   P                  P                  VP                  P                  4       4       F  '       d   K   R# 	  R# ! R \        V P                   P                  P                  VP                  P                  4       4       4      # )r   c              3     "   T F7  w  rVP                   VP                   \        VP                   R R4      39   x  K9  	  R# 5i)elemN)r|   getattr)r   argref_args   &  r&   r   +is_reference_for_foreach.<locals>.<genexpr>g  s<      
! LLSXXwsxx'FGG!s   ?AFT)r<   r;   r   r^   inplacer   _foreach_with_inplace_ref_skip_argument_len_checkrO   	argumentsflat_non_outallzip)r`   r   s   &&r&   is_reference_for_foreachr   X  s|   
 	
##K048L8L8Q8Q8V8VV 	
 	
$$))111 = =166;;#<<	
 	
  88 ; ;166##001?,,99:;	
 	
 C 
 #  --))66!
CC   
 #  --))66!
 
r%   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
rI   foreach_functionr   functional_info_by_signature6dict[FunctionSchema, dict[str, DifferentiabilityInfo]] non_functional_info_by_signaturedispatch_keyr   rJ   z)tuple[DifferentiabilityInfo | None, bool]r   )rK   s   "r&   rL   rL   r  sC     [ [$[#[
'[ [ /[r%   c                r   RpVP                  4        F&  w  rV\        W4      '       g   K  Wc,          pVf   K&   M	  Vf   V P                  P                  4       \        P
                  8X  dc   \        V P                  P                  4      \        9   d;   VP                  4        F&  w  rV\        W4      '       g   K  Wc,          pVf   K&   M	  Vf   R# V P                  P                  4       \        P
                  8X  d   VR3# / / r\        \        V P                  P                  P                  XP                  P                  4      4       F.  w  p	w  rV
P                  W{P                  &   WV
P                  &   K0  	  . . . rp. p\        VP                  4       EF  w  p	pVP                  P                  RR4      P                  RR4      p. . pp\         P"                  ! V P$                  V P&                  R7      ;_uu_ 4        VP(                   EF  pVP*                  P-                  R4      ^ ,          pVV,          p\/        VV,          P0                  \2        4      '       d   VR	,           pMTpVP*                  P                  VV4      pVP                  \5        \        VP6                  P                  4      V4      p\8        P:                  ! VV,          VR
7      p\=        VP                  VP0                  P?                  4       4      pVPA                  \C        VVR7      4       EK  	  VPD                   F]  pVP6                  P                  R8X  d7   VPA                  \C        \=        R\G        \H        4      R7      RR7      4       KT  \K        R4      h	  RRR4       VPL                   Uu. uF  pVV,          NK  	  ppVPO                  V4       VPO                  V4       VPO                  V4       \Q        VVP                  \S        V4      \S        V4      \S        V4      \U        4       R7      pVPA                  V4       EK  	  \         P"                  ! V P$                  V P&                  R7      ;_uu_ 4        V P                  P                  P                   U
u. uFN  p
V
P                  V9   g   K  \W        V
P                  \8        P:                  ! WP                  R
7      V
RR7      NKP  	  pp
RRR4       . p VPX                   EF  p!\[        V!PL                  4      p\[        V!P\                  4      p". p#. p$V!P^                  e   \[        V!P^                  4      p#V!P`                  '       d   \[        V!P`                  4      p$V!P                  pRV9   d   V!P                  P                  RR4      p\        V P                  P                  P                  VP                  P                  P                  P                  4       EFt  w  p%p\/        V%P0                  \2        4      '       dP   V%P0                  Pc                  4       '       g0   VP                  VP                  V%P                  R	,           4      pEMJV%P0                  Pc                  4       '       d   \/        V%P0                  \2        4      '       g   V%P0                  \e        \f        Ph                  4      8X  d)   \        V P                  P                  4      \j        9   g/   \m        V P                  P                   RV%P0                   24      hR FD  p&VP                  V&,           p'V'V9   g   K  V%P                  V&,           pVP                  V'V4      pKF  	  MAV%P                  VP                  8w  d'   VP                  VP                  V%P                  4      p\        V4       F7  w  p	p(V(VP                  8X  g   K  V%P                  VV	&   V%P0                  V"V	&   K9  	  \        V#4       F(  w  p	p(V(VP                  8X  g   K  V%P                  V#V	&   K*  	  \        V$4       F(  w  p	p(V(VP                  8X  g   K  V%P                  V$V	&   K*  	  EKw  	  V PA                  \o        V\S        V4      \S        V"4      \S        V#4      \S        V$4      V!Pp                  V!Pr                  R7      4       EK  	  \u        V P                  P                  P                  Pv                  V RVPx                   V P                  P                  Pz                   2VV \S        \U        V4      4      \S        \U        V4      4      R\U        4       X. RRR7      R3#   + '       g   i     EL; iu upi u up
i   + '       g   i     EL; i)zGenerate DifferentiabilityInfo for out-place foreach function, return the existing one for in-place.

The second return value indicates whether the info is generated in this function.
NFrx   zgrads[i]resultz	result[i])!use_const_ref_for_mutable_tensorsuse_ilistref_for_tensor_listsrX   z[i])binds)r   r   )r;   r|    )r)   r*   r,   r-   r.   r0   )r;   r   argumentdefaultz, r)   r,   r3   r4   r5   r7   r8   Foreachr\   TNF)_p_tr   )>itemsr   r<   kindr   r   r   r;   r   	enumerater   r   r   r>   r)   replacer   parametrizer   part_of_structured_groupr-   r   r^   
isinstancer|   r   r   r   r   argument_typer   remove_const_refappendr   r.   r	   r   RuntimeErrorr,   extendr(   tuplesetr
   r?   listr3   r4   r5   is_tensor_liker   r   Tensor_foreach_with_tensor_overloadAssertionErrorr2   r7   r8   r:   r   r=   overload_name))r   r   r   r   ref_diff_infor   	diff_infomap_refarg2foreachargmap_name2argir   r   r@   rA   all_var_namesmodified_derivative_formulasrm   modified_formular-   r.   	ref_inputref_input_jit_namemapped_namemapped_exprnew_exprr   canonical_nctype
ref_outputvarr,   modified_derivativerD   r?   fw_derivativer3   r4   r5   foreach_argsuffix	curr_exprr;   s)   &&&&                                     r&   gen_foreach_derivativeinfor   r  so    37M&B&H&H&J"'(8JJ!/$ 'K 	!!&&(J,>,>> %%**+/HH*J*P*P*R&O+,<NN%3M( +S  !!#z'9'99e##*,b<&!!++88%%22	
>C /2hhll+!$SXX :<R#% "=#<#<=:%--55fjIQQk
 ')"m.>.`.`*:*S*S
 
 (44	%.^^%9%9#%>q%A"34FGl;7<<hGG"-"5K"-K$>>112DkR#3#;#;i..334h$  **<+DKX#-KK!=!=!?$  ##"*:M! 5& )66
$$))X5!((&#-%-Ik4J$ "*	 'r** 7/
F <F;O;OP;OC*3//;O	PY'-  /($'//I&|,.E
 	%++,?@k >n 
		*:*\*\&6&O&O
 
 (,,66CC	!
 Dxx=(GXX((HH=	 D 	 	!
	
 46&::#M$;$;<	 $]%<%< =	-/,.00<&*=+P+P&Q#///%)-*N*N%O"(00 '',44<<X{S$'!!++88##--::%
 K ;++X66#((7799 $4#;#;LL+"2"2U":$  !!0022 {//::#((HV]],CC 0 5 5 : :;89 )+00556b9I9I8JK  +F 'v 5I $44#.#3#3f#<+;+C+CIx+X(	 + ##w||3'7'?'?k&6&6($
 %Y/47<<'#.#3#3IaL#.#3#3IaL 0 %%<=47<<'1<1A1A+A. > %%;<47<<'0;0@0@*1- =]%
b 	""(	*	*(-.E(F',-C'D-:-W-W,9,U,U
	
A ;Z 	!&&++0055!))*+;+@+@+E+E+S+S*TU4 3"3'7#89#C(9$:;&(!$"7)+%)04	
 	! ]
 
 
F Q$	!
	
 
 
s7   
Ff:f	#f%,f <f  f%f f%%f6	c               $    V ^8  d   QhRRRRRR/# )rI   native_functionszlist[NativeFunction]differentiability_infosr   rJ   z-list[NativeFunctionWithDifferentiabilityInfo]r   )rK   s   "r&   rL   rL   P  s+     ~ ~*~S~ 3~r%   c                	  aaa SP                  4        UUu/ uF=  w  r#VP                  4       \        P                  8X  g   K*  VP	                  RR7      VbK?  	  uppoSP                  4        UUu/ uF=  w  r#VP                  4       \        P                  8w  g   K*  VP	                  RR7      VbK?  	  uppoR VVV3R llp. pV  EF  pV! V4      w  r7VP
                  P                  4       \        P                  8X  d~   Vez   VP                  4        Fe  pVP                   FR  p	RV	P                  9   g   K  V	P                   F,  p
RV
P                  9   g   K  \        RVP
                   24      h	  KT  	  Kg  	  V'       g    VP                  \        VRRR	7      4       K  / pVP                  4        EF  w  rVP                  '       g   . W&   K  VP                  pVP
                  P                  4       \        P                  8X  Ed   \!        VP                  4      ^8w  d"   \        R
\!        VP                  4       24      hVP                  ^ ,          pVP"                  pR R lp\$        P&                  ! \(        P*                  ! R4      V4      '       d>   V'       d$   \-        RVP
                  P.                   R24      hV! VR4      pV! VR4      pR R lp\$        P0                  ! \(        P*                  ! R4      VV4      pVP2                  p\$        P&                  ! \(        P*                  ! R4      V4      '       d   V'       d
   VR",           MR"pV'       g   RpRpRpRp\$        P4                  ! RV4      pV'       dJ   VP7                  ^4      VP7                  ^4      ppR R lpV! V4      pT;'       d    VVP.                  8H  pV'       d+   Vf   \        R4      hVf   \        R4      hRV RV RV 2pMRV RV 2p\9        \$        P&                  ! \(        P*                  ! R4      V4      4      ;'       g5    \9        \$        P&                  ! \(        P*                  ! R 4      V4      4      p\;        VR"VP<                  VP>                  VVV'       * R!7      .pWV&   EK  	  VP                  \        WcVR	7      4       EK  	  V# u uppi u uppi )#zSets the "derivative" key on declarations to matching autograd function
In-place functions will use the out-of-place derivative definition if there
is no in-place specific derivative.
Tstrip_defaultc                    V ^8  d   QhRRRR/# )rI   r`   r   rJ   z4tuple[dict[str, DifferentiabilityInfo] | None, bool]r   )rK   s   "r&   rL   2match_differentiability_info.<locals>.__annotate__d  s     ; ;;	=;r%   c                  < R V P                   9   d0   V P                  P                  4       \        P                  8X  d   R
# V P                  S9   d   SV P                  ,          R3# V P                  P                  RR7      pVS9   d   \        V 4      '       g   SV,          R3# R V P                   9   d   VS9   d   SV,          p\        ;QJ d*    R VP                  4        4       F  '       g   K   RM	  RM! R VP                  4        4       4      '       d#   \        R\        V P                  4       R24      hVR3# \        V 4      '       dw   V P                  S9   d$   \        RV P                  P                   R24      h\        V SS4      w  r4Vf   R
# R	V/pV'       d   VSV P                  &   VSV P                  &   WT3# R
# )	generatedFTr   c              3     "   T FM  p\         ;QJ d&    R  VP                   4       F  '       g   K   RM	  RM! R  VP                   4       4      x  KO  	  R# 5i)c              3  f   "   T F'  pR \        VP                  P                  4      9   x  K)  	  R# 5i)rQ   N)r   r   r;   )r   inputs   & r&   r   Lmatch_differentiability_info.<locals>.find_info.<locals>.<genexpr>.<genexpr>  s&     XBWFc%,,"3"344BWs   /1TFN)r   r@   r   s   & r&   r   Bmatch_differentiability_info.<locals>.find_info.<locals>.<genexpr>  sA      .D X$BWBWXX$BWBWXXX.s   AA'AzvAttempted to convert a derivative formula for a mutable operator to be used automatically by its functional variant ("zU"). This is not currently supported (we'd need to fix up the formula in the codegen).zForeach function z# already has differentiability infoDefaultr   )tagsr<   r   r   out	signaturer   r   r   r   r   r;   r   )	r`   f_sig	info_dictr   is_generateddiff_info_dictr   r   r   s	   &     r&   	find_info/match_differentiability_info.<locals>.find_infod  s    !&& QVV[[]jnn%D 66,,*1662D88   t 4009K9K/6== !&& U.N%N8?Is %,,.sss %,,.   %LLOPQPVPVK= Yhh 
 e## 1vv00$'}4WX  'A,0'#I
  ""'3N2@'/7E,QVV4!//r%   NrQ   strides_or_errorz`Calling '.strides()' in the 'self' derivative formula of an in-place function is not supported: )r<   rh   r   z-Only single output inplace should exist, got c               $    V ^8  d   QhRRRRRR/# )rI   r)   r   postfixrJ   r   )rK   s   "r&   rL   r     s'     W WS W3 WSV Wr%   c                r   a R  V3R llp\         P                  ! \        P                  ! RS 24      W 4      # )c                    V ^8  d   QhRRRR/# rI   mzre.Match[str]rJ   r   r   )rK   s   "r&   rL   [match_differentiability_info.<locals>.replace_self_with_original_self.<locals>.__annotate__  s     Q Q Q# Qr%   c                R   < V P                  ^4       RS V P                  ^4       2# )rZ   original_selfgroup)r  r  s   &r&   replSmatch_differentiability_info.<locals>.replace_self_with_original_self.<locals>.repl  s(    "#''!*]7)AGGAJ<PPr%   rQ   )rk   subr   rK   )r)   r  r  s   &f r&   replace_self_with_original_selfEmatch_differentiability_info.<locals>.replace_self_with_original_self  s4    Q Q 66+"4"4tG95E"FVVr%   self_pzThe formula for "z" is using the original value of self that is being modified inplace. This would lead to wrong forward gradients. Please use "result" in the formula only.r   r   c                    V ^8  d   QhRRRR/# r  r   )rK   s   "r&   rL   r     s     = =M =c =r%   c                L    V P                  ^4       RV P                  ^4       2# )rZ   r  r  )r  s   &r&   r  *match_differentiability_info.<locals>.repl  s#    ggaj\
|<<r%   r   Fzself_t.([\w]*)\((.*)\)c                    V ^8  d   QhRRRR/# )rI   sr   rJ   r6   r   )rK   s   "r&   rL   r     s     	( 	(s 	(t 	(r%   c                t    ^pV  F/  pVR8X  d   V^,          pV^ 8X  d    R# VR8X  g   K&  V^,          pK1  	  R# )rZ   )F(Tr   )r  levelchs   &  r&   check_parens_nest_level_gt_zeroEmatch_differentiability_info.<locals>.check_parens_nest_level_gt_zero  s@    $%E&'#%9$)QJE',z/4#%9$)QJE '( $(r%   z$op_name must be non-None for inplacez+between_parens must be non-None for inplacez"self_t_raw.defined() ? self_t_raw.z_(z) : z(self_t_raw.defined() ? self_t_raw.copy_(original_self_poriginal_self_tr   rP   ) r   r   r   
functionalr   r<   r   r   r>   r,   r-   r   r   r   r   r?   rO   r)   rk   rl   r   rK   r   r;   r  r5   	fullmatchr  r6   r2   r3   r4   )r   r   schemar   r   r   r`   is_exact_matchrh   rm   saved_inputfw_derivative_dictkeyr?   fw_infor)   r  r  required_primalsis_single_method_on_self_tdirectly_do_inplaceop_namebetween_parensmatchr  r7   r   r   s   &f                        @@r&   match_differentiability_infor0  P  s    "9!>!>!@$!@F;;=J111 	8t,i7!@$  "9!>!>!@(!@F;;=J111 	8t,i7!@($; ;z =?F$-aL!	 66;;=J...I4I!((*"&"2"2J!5!55+5+B+BK1[5E5EE&4%KKL66(%T'" !" ,C #3 + MM7d
 EG"*IC+++*,"'"&":": vv{{}
 2 22( t//0A5("4#;#;<=?  2215!//W 99[//97CC%*/} =G G  #B'4"P"A'4"P= &&!3!3H!=tWM#*#A#A 99[//97CC8H(94i % & 27.*/'*.G15NLL)BGLE27++a.%++a.	( 6U*62 7OO7dii;O , +"?"01W"XX)1"0 M#  %GwirR`Qaaefmen"o %MWIUYZaYb"c/3IIk001BCWM0 0U 0U"))K$6$67H$I7ST -
 & '"+")"3"3070O0O/?5Q8F4F
'# ':s#W +Z 	37I	
M X Mk$
(s   'SS1'S S c               (    V ^8  d   QhRRRRRRRR/# )	rI   r;   r   r|   r   rh   rV   rJ   r6   r   )rK   s   "r&   rL   rL   Q  s,      
!=	r%   c                f    VP                  4       ;'       d    VR J ;'       g    WP                  9  # r   )r   rE   )r;   r|   rh   s   &&&r&   is_differentiabler3  Q  s7        EE$E$EEr%   c               $    V ^8  d   QhRRRRRR/# )rI   r   r   r(  r   rJ   zlist[DifferentiableOutput]r   )rK   s   "r&   rL   rL   Y  s$     #0 #0/#069#0#0r%   c                t  a V P                   pV P                  '       d   V P                  V,          MR o\        \        P                  ! V4      VP                   P
                  4       UUu. uFA  w  r4\        VVP                  \        P                  ! VRR7      P                  4       R7      NKC  	  pppS'       d   SP                  MR pVe   \        V4      \        V4      8w  d%   \        R\        V4       R\        V4       R24      h. pRV9   d9   VP                   P                  4       \        P                  8X  d   \        R4      h\        We4       F   w  rV'       g   K  VP!                  V	4       K"  	  V# \#        \%        V3R	 lV4      4      p
\'        S4      '       d
   V
R
,          # V
# u uppi )NT)symint)r;   r|   r}   z(The length of output_differentiability (z)), does not match the number of outputs (z).FzXoutput_differentiability=False for inplace operation (version_counter won't get updated)c                F   < \        V P                  V P                  S4      # r   )r3  r;   r|   )rrh   s   &r&   <lambda>,gen_differentiable_outputs.<locals>.<lambda>w  s    *1661664@r%   :NrZ   N)r<   rh   r   r   return_namesreturnsr   r|   return_typer}   rF   rO   r   r   r   r   r   r   filterry   )r   r(  r`   r;   retoutputsrF   differentiable_outputsdifferentiableoutput candidate_differentiable_outputsrh   s   &&         @r&   gen_differentiable_outputsrE  Y  s    	A7772773<D S--a0!&&..A+ BID 	__S6??A	

 B  + AEt<<$+'(CL8:3?W;X:Y Z99<WbJ  >@,,*BTBT1Tj  '**B&L"N~&--f5 'M &%'+@'J($ /33//=+s   ,AF4>   _foreach_add.Tensor_foreach_div.Tensor_foreach_mul.Tensor>   _foreach_add.Scalar_foreach_sub.Scalar_foreach_add_.Scalar_foreach_sub_.Scalar_foreach_add.ScalarList_foreach_sub.ScalarList_foreach_add_.ScalarList_foreach_sub_.ScalarList)r   )2
__future__r   rk   dataclassesr   typingr   r   torchgenr   torchgen.apir   torchgen.api.typesr	   r
   r   r   torchgen.modelr   r   r   r   r   r   r   r   torchgen.utilsr   collections.abcr   r   r(   r2   r:   rn   ru   ry   r{   r   r   r   r   r   r   r   r   r   r0  r3  rE  r   r%   r&   <module>rZ     si   " 	 ! &   J J	 	 	 ' ( $   $  6 $& & &< $h
 h
 h
V0$ $    $   $B B B.b9 .. ! 	 4[|~B#0 #0r%   