+
    &j                     a 0 t $ ^ RIHt ^ RIt^ RI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 ]'       d   ^ RIHtHtHt ]! R	R
7       ! R R4      4       t ! R R]	4      tRt. RnOt. RoOtR.] U u. uF  p RV ,           NK  	  up ,           tRR0t ! R R]	4      t ! R R]	4      tR R lt] FA  t] F8  t ]!! ]]] ,           4      '       d   K  ]! 4       t"]#! ]"4       ]$! R] ]  R]" 24      h	  KC  	  ]PJ                  ]PL                  ]PN                  ]PP                  ]PR                  0t*]PL                  ]PN                  0t+]PN                  ]PX                  ]PZ                  ]P\                  ]PL                  ]PJ                  ]PP                  ]P^                  ]P`                  ]Pb                  ]Pd                  ]Pf                  ]Ph                  ]Pj                  ]Pl                  ]Pn                  ]Pp                  ]Pr                  ]Pt                  ]Pv                  ]Px                  ]Pz                  ]P|                  ]P~                  ]P                  ]P                  ]P                  ]P                  ]P                  ]PR                  .tER R ltFR R ltGR  R! ltHR" R# ltIR$ R% ltJ]GR&]HR'/tK ! R( R)]	4      tL/ tMR*]NR+&   ]! ]LP                  ]LP                  ]LP                  ]LP                  ]LP                  .4      ]MR,&   ]! ]LP                  ]LP                  .4      ]MR-&   ]! ]LP                  ]LP                  .4      ]MR.&   ]MR,,          ]MR-,          ,          ]MR/&   ]MR/,          ]MR.,          ,          ]MR0&   ]MR-,          ]MR.,          ,          ]MR1&    ! R2 R3]	4      tX ! R4 R5]	4      tY ! R6 R7]	4      tZ]! R	R
7       ! R8 R94      4       t[ ! R: R;]	4      t\]! R	R
7       ! R< R=4      4       t]]! R	R
7       ! R> R?4      4       t^]! R	R
7       ! R@ RA4      4       t_]! R	R
7       ! RB RC4      4       t`]! R	R
7       ! RD RE4      4       ta]! R	R
7       ! RF RG4      4       tb]! R	R
7       ! RH RI4      4       tc ! RJ RK]	4      td]! R	R
7       ! RL RM]c4      4       te]! R	R
7       ! RN RO]c4      4       tf]! R	R
7       ! RP RQ]c4      4       tg]! R	R
7       ! RR RS]c4      4       th]! R	R
7       ! RT RU4      4       ti]! R	R
7       ! RV RW4      4       tj]! R	R
7       ! RX RY4      4       tk]! R	R
7       ! RZ R[4      4       tl]! R	R
7       ! R\ R]4      4       tm. RpOtn]! R	R
7       ! R^ R_4      4       to]! R	R
7       ! R` Ra4      4       tpRb Rc ltq]! R	R
7       ! Rd Re4      4       trRf Rg ltsRh Ri lttRj Rk ltu]! R	R
7       ! Rl Rm4      4       tvR# u up i )q    )annotationsN)	dataclass)autoEnum)TYPE_CHECKING)assert_never)NamespaceHelper
OrderedSet)CallableIteratorSequenceT)frozenc                  8    ] tR t^,t$ R]R&   R]R&   R R ltRtR# )	Locationstrfileintlinec                   V ^8  d   QhRR/#    returnr    )formats   "f/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torchgen/model.py__annotate__Location.__annotate__1   s     * * *    c                	8    V P                    R V P                   2# ):)r   r   selfs   &r   __str__Location.__str__1   s    ))Adii[))r   r   N)__name__
__module____qualname____firstlineno____annotations__r#   __static_attributes__r   r   r   r   r   ,   s    
I
I* *r   r   c                  2    ] tR t^6t]! 4       t]! 4       tRtR# )Variantr   N)r%   r&   r'   r(   r   functionmethodr*   r   r   r   r,   r,   6   s    vHVFr   r,   z
at::nativeAutogradAutogradNestedTensor	quantizedquantized_decomposedc                     ] tR t^dt^ t]t]! 4       t]! 4       t]! 4       t	]! 4       t
]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t ]! 4       t!]! 4       t"]! 4       t#]! 4       t$]! 4       t%]! 4       t&]! 4       t']! 4       t(]! 4       t)]! 4       t*]! 4       t+]! 4       t,]! 4       t-]! 4       t.]! 4       t/]! 4       t0]! 4       t1]! 4       t2]! 4       t3]! 4       t4]! 4       t5]! 4       t6]! 4       t7]! 4       t8]! 4       t9]! 4       t:]! 4       t;]! 4       t<]! 4       t=]! 4       t>]! 4       t?]! 4       t@]! 4       tA]! 4       tB]! 4       tC]! 4       tD]! 4       tE]! 4       tF]! 4       tG]! 4       tH]! 4       tI]! 4       tJ]! 4       tK]! 4       tL]! 4       tM]! 4       tN]! 4       tO]! 4       tP]! 4       tQ]! 4       tR]! 4       tS]! 4       tT]! 4       tU]! 4       tV]! 4       tW]! 4       tX]! 4       tY]! 4       tZ]! 4       t[]! 4       t\]! 4       t]]! 4       t^]! 4       t_]! 4       t`]! 4       ta]! 4       tb]! 4       tc]! 4       td]! 4       te]! 4       tf]! 4       tg]! 4       th]! 4       ti]! 4       tj]! 4       tk]! 4       tl]! 4       tm]! 4       tn]! 4       to]! 4       tp]! 4       tq]! 4       tr]! 4       ts]! 4       tt]! 4       tu]! 4       tv]! 4       tw]! 4       tx]! 4       ty]! 4       tz]! 4       t{]! 4       t|]! 4       t}]! 4       t~]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       tR R ltR R lt]R R l4       tRtR# )	DispatchKeyc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   DispatchKey.__annotate__          r   c                	    V P                   # Nnamer!   s   &r   r#   DispatchKey.__str__       yyr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r6      s     ! !s !r   c                	4    \        V 4      P                  4       # r9   )r   lowerr!   s   &r   r@   DispatchKey.lower   s    4y  r   c                    V ^8  d   QhRRRR/# )r   valuer   r   r4   r   )r   s   "r   r   r6      s     > >S >[ >r   c                	    \         P                  P                  4        F  w  rW8X  g   K  Vu # 	  \        R V  24      h)zunknown dispatch key )r4   __members__itemsAssertionErrorrC   kvs   &  r   parseDispatchKey.parse   s<    ++113DAz 4 4UG<==r   r   N)r%   r&   r'   r(   	UndefinedCatchAllr   FPGAMAIAVulkanMetalMKLDNNOpenGLOpenCLIDEEPCustomRNGKeyId	MkldnnCPUSparse	SparseCsrNestedTensorDensePythonTLSSnapshotPreDispatchPythonDispatcherPythonFuncTorchDynamicLayerBackMode
ZeroTensor	ConjugateNegativeBackendSelectNamedAutogradOtherAutogradFunctionalityr0   TracerAutocastAutocastCPUAutocastCUDABatchedVmapModeFuncTorchGradWrapperFuncTorchBatchedBatchedNestedTensorFuncTorchVmapModeFuncTorchDynamicLayerFrontModeFunctionalizeTESTING_ONLY_GenericWrapperTESTING_ONLY_GenericModeADInplaceOrViewr/   CompositeImplicitAutograd%CompositeImplicitAutogradNestedTensorCompositeExplicitAutograd&CompositeExplicitAutogradNonFunctionalFuncTorchBatchedDecompositionCPUCUDAHIPXLAMTIAMPSIPUXPUHPUVELazyMetaPrivateUse1PrivateUse2PrivateUse3QuantizedCPUQuantizedCUDAQuantizedHIPQuantizedXLAQuantizedMTIAQuantizedMPSQuantizedIPUQuantizedXPUQuantizedHPUQuantizedVEQuantizedLazyQuantizedMetaQuantizedPrivateUse1QuantizedPrivateUse2QuantizedPrivateUse3	SparseCPU
SparseCUDA	SparseHIP	SparseXLA
SparseMTIA	SparseMPS	SparseIPU	SparseXPU	SparseHPUSparseVE
SparseLazy
SparseMetaSparsePrivateUse1SparsePrivateUse2SparsePrivateUse3SparseCsrCPUSparseCsrCUDASparseCsrHIPSparseCsrXLASparseCsrMTIASparseCsrMPSSparseCsrIPUSparseCsrXPUSparseCsrHPUSparseCsrVESparseCsrLazySparseCsrMetaSparseCsrPrivateUse1SparseCsrPrivateUse2SparseCsrPrivateUse3NestedTensorCPUNestedTensorCUDANestedTensorHIPNestedTensorXLANestedTensorMTIANestedTensorMPSNestedTensorIPUNestedTensorXPUNestedTensorHPUNestedTensorVENestedTensorLazyNestedTensorMetaNestedTensorPrivateUse1NestedTensorPrivateUse2NestedTensorPrivateUse3AutogradCPUAutogradCUDAAutogradHIPAutogradXLAAutogradMTIAAutogradMPSAutogradIPUAutogradXPUAutogradHPU
AutogradVEAutogradLazyAutogradMetaAutogradPrivateUse1AutogradPrivateUse2AutogradPrivateUse3r#   r@   staticmethodrK   r*   r   r   r   r4   r4   d   s   IH6D6DVFFEVFVFVFFEVNIVFI6LFE&KvVF$(F!JIvHFMFEFM F6VFvH&K6LfGvH6v&%)V"FM"&&#vfOvH $,0F) $-1V*$(F! &C6D
&C
&C6D
&C
&C
&C
&C	B6D6D&K&K&K6LFM6L6LFM6L6L6L6L&KFMFM666IJIIJIIIIvHJJ6LFM6L6LFM6L6L6L6L&KFMFM666fOvfOfOvfOfOfOfOVNvv"f"f"f&K6L&K&K6L&K&K&K&KJ6L6L&&&! > >r   r4   c                  @    ] tR tRt]! 4       t]! 4       t]! 4       tRtR# )_TorchDispatchModeKeyi  r   N)	r%   r&   r'   r(   r   FAKEPROXY
FUNCTIONALr*   r   r   r   r   r     s    6DFEJr   r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     s      S r   c                    a . p \          F"  oV P                  V3R  l\         4       4       K$  	  RP                  V 4      # )c              3  4   <"   T F  pR S V R2x  K  	  R# 5i)z    z	 = auto()Nr   ).0bcfks   & r   	<genexpr>.codegen_per_backend_entries.<locals>.<genexpr>  s      G4Fb4tB4y)4F   
)FUNCTIONALITY_KEYSextendBACKEND_COMPONENTSjoin)rr   s    @r   codegen_per_backend_entriesr     s3    A 	G4FGG !99Q<r   zMissing zL from DispatchKey enum.  Here is the autogenerated list we expect to have:

c                    V ^8  d   QhRRRR/# r   dkr4   r   boolr   )r   s   "r   r   r   M  s        r   c                    V \         P                  \         P                  \         P                  \         P                  09   # r9   )r4   rz   r{   rx   ry   r   s   &r   is_generic_dispatch_keyr   M  s8    --::--99	  r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   W  s      [ T r   c                    V \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  09   # r9   )r4   r~   r   r   r   r   r   r   s   &r   is_cuda_dispatch_keyr   W  sJ    !!!!$$    r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   c  s      K D r   c                    V \         P                  \         P                  \         P                  \         P                  \         P
                  \         P                  09   # r9   )r4   r   r   r   r   r   r   r   s   &r   is_xpu_dispatch_keyr   c  sH        ##  r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   p  s     * *; *4 *r   c                    V \         9   # r9   )STRUCTURED_DISPATCH_KEYSr   s   &r   is_structured_dispatch_keyr   p  s    )))r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   t  s     % %k %d %r   c                    V \         9   # r9   )UFUNC_DISPATCH_KEYSr   s   &r   is_ufunc_dispatch_keyr  t  s    $$$r   cudaxpuc                  `   ] tR tRt]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t	]! 4       t
]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       tR R lt]R R l4       t]R R l4       t]R R	 l4       tR
tR# )
ScalarTypei}  c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ScalarType.__annotate__  r7   r   c                	    V P                   # r9   r:   r!   s   &r   r#   ScalarType.__str__  r=   r   c                    V ^8  d   QhRRRR/# )r   rC   r   r   zScalarType | Noner   )r   s   "r   r   r    s      3 #4 r   c                	h    \         P                  P                  4        F  w  rW8X  g   K  Vu # 	  R # r9   )r  rE   rF   rH   s   &  r   maybe_parseScalarType.maybe_parse  s,    **002DAz 3 r   c                    V ^8  d   QhRRRR/# )r   rC   r   r   r  r   )r   s   "r   r   r    s      S Z r   c                	T    \         P                  V 4      pVf   \        RV  24      hV# )Nzunknown dtype )r  r  rG   )rC   mb_rs   & r   rK   ScalarType.parse  s.    %%e,< >%!9::r   c                    V ^8  d   QhRRRR/# )r   valuesr   r   OrderedSet[ScalarType]r   )r   s   "r   r   r    s      # "8 r   c                	    \        4       pV P                  R 4       FP  pV\        9   d   VP                  \        V,          4       K,  VP	                  \
        P                  V4      4       KR  	  V# ), )r
   splitDTYPE_CLASSESupdateaddr  rK   )r  dtypesrC   s   &  r   	parse_setScalarType.parse_set  sS    )3\\$'E%mE23

:++E23	 (
 r   r   N)r%   r&   r'   r(   r   ByteCharShortIntLongHalfFloatDoubleComplexHalfComplexFloatComplexDoubleBoolBFloat16Float8_e5m2Float8_e5m2fnuzFloat8_e4m3fnFloat8_e4m3fnuzFloat8_e8m0fnur#   r   r  rK   r  r*   r   r   r   r  r  }  s    6D6DFE
&C6D6DFEVF&K6LFM6DvH&KfOFMfOVN      r   r  z!dict[str, OrderedSet[ScalarType]]r  IntegralFloatingComplexAllAllAndComplexFloatingAndComplexc                      ] tR tRt]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t	]! 4       t
]! 4       tR R lt]R R l4       tRtR# )UfuncKeyi  c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   UfuncKey.__annotate__  r7   r   c                	    V P                   # r9   r:   r!   s   &r   r#   UfuncKey.__str__  r=   r   c                    V ^8  d   QhRRRR/# )r   rC   r   r   r7  r   )r   s   "r   r   r9    s     ; ;S ;X ;r   c                	    \         P                  P                  4        F  w  rW8X  g   K  Vu # 	  \        R V  24      h)zunknown ufunc key )r7  rE   rF   rG   rH   s   &  r   rK   UfuncKey.parse  s<    ((..0DAz 1 1%9::r   r   N)r%   r&   r'   r(   r   CUDAFunctorCUDAFunctorOnOtherCUDAFunctorOnSelf	CPUScalar	CPUVector
ScalarOnlyGenericr#   r   rK   r*   r   r   r   r7  r7    sR     &KII JfG ; ;r   r7  c                      ] tR tRt^ t^tRtR# )DeviceCheckTypei  r   N)r%   r&   r'   r(   NoCheck	ExactSamer*   r   r   r   rG  rG    s    GIr   rG  c                  @    ] tR tRt]! 4       t]! 4       t]! 4       tRtR# )ViewSchemaKindi  r   N)	r%   r&   r'   r(   r   aliasingaliasing_inplacenon_aliasingr*   r   r   r   rK  rK    s    vHv6Lr   rK  c                     ] tR tRt$ 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&   R]R&   R]R&   R]R&   R]R&   R]R &   R]R!&   R]R"&   R]R#&   R]R$&   R]R%&   ]R8R' R( ll4       tR) R* ltR+ R, lt]	R- R. l4       t
]	R/ R0 l4       t]	R1 R2 l4       t]	R3 R4 l4       t]	R5 R6 l4       tR7tR&# )9NativeFunctioni  r   	namespaceFunctionSchemafuncr   !use_const_ref_for_mutable_tensorsdevice_guardrG  device_check
str | Nonepython_modulecategory_overridezset[Variant]variantsmanual_kernel_registrationmanual_cpp_bindingr   loczlist[OperatorName]autogenzdict[UfuncKey, UfuncInnerLoop]ufunc_inner_loop
structuredzOperatorName | Nonestructured_delegatestructured_inheritszPrecompute | Noneprecomputedset[str]cpp_no_default_argsis_abstract&has_composite_implicit_autograd_kernel4has_composite_implicit_autograd_nested_tensor_kernel&has_composite_explicit_autograd_kernel5has_composite_explicit_autograd_non_functional_kerneltagsNc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   eizdict[str, object]r]  r   
valid_tagsrd  ignore_keyszset[DispatchKey] | Noner   zMtuple[NativeFunction, dict[DispatchKey, dict[OperatorName, BackendMetadata]]]r   )r   s   "r   r   NativeFunction.__annotate__p  sB     O
 O
O
O
 O
 -	O

 
WO
r   c           	        V P                  4       pVP                  R4      p\        V\        4      '       g   \	        RV 24      h\
        P                  ! V^R7      pVP                  RR7      p\        P                  VP                  4      pVP                  R. 4      p	\        V	\        4      '       g   \	        RV	 24      h\        V	4      p
VP                  RR	4      p\        V\        4      '       g   \	        R
V 24      hV'       d(   VP                  P                  '       d   \	        R4      hVP                  RR4      p\        V\        4      '       g   \	        RV 24      h\        4       pVP!                  R4       F_  pVR8X  d"   VP#                  \$        P&                  4       K+  VR8X  d"   VP#                  \$        P(                  4       KS  \	        RV 24      h	  VP                  RR	4      p\        V\        4      '       g   \	        RV 24      hVP                  RR	4      p\        V\        4      '       g   \	        RV 24      hVP                  RR4      p\        V\        4      '       g   \	        RV 24      hVP                  RR4      pVe%   \        V\        4      '       g   \	        RV 24      hVe$   V\*        P,                  9   g   \	        RV 24      hVf   \*        P.                  pM\*        V,          pVP                  RR	4      p\        V\        4      '       g   \	        RV 24      hVP                  RR4      pVe%   \        V\        4      '       g   \	        RV 24      hVe   RV9   d   \	        R4      hRpVe   \0        P                  V4      pVP                  RR4      pVe%   \        V\        4      '       g   \	        RV 24      hVe   RV9   d   \	        R4      hVP                  R R4      pVe%   \        V\        4      '       g   \	        RV 24      hVe!   \$        P(                  V9   d   \	        R!4      hVP                  R"R4      pVe%   \        V\        4      '       g   \	        RV 24      hVP                  R#R4      pVe   VRJd   \	        R$V 24      hV'       d   \2        P                  V4      MRpVP                  R%. 4      p\        V\        4      '       d   V.p\        V\        4      '       g   \	        R&V 24      hVR8X  d   R'V9   d   VP5                  R'4       \        4       pV FD  p\7        V4      ^ 8X  d   \	        R(4      hVV9   d   VP#                  V4       K8  \	        R)V 24      h	  ^ R*IHp VP                  R+R4      p V e%   \        V \<        4      '       g   \	        R,V 24      h/ p!^ p"V Ee9   V'       d   \	        R-4      hR	p#V P?                  4        EF_  w  p$pV$R.8X  d   K  \        V$\        4      '       g   \	        R/V$ R0V  24      h\        V\        4      '       g   \	        R1V R0V  24      hV$P!                  R24       F  p%\@        P                  V%PC                  4       4      p&V"^,          p"V'       d
   V&V9   d   K@  V&\D        9  d   \	        R3V& R4V R524      h\
        P                  ! V^R67      pVP                  R7R7      p'\G        VP                  T;'       d    \I        V&4      V'R8,           R97      V!V&&   V&\@        PJ                  J g   K  VVPM                  V4      8X  g   K  Rp#K  	  EKb  	  V"^8X  d   V#'       d   \	        R:4      hV'       g   V!PO                  4       \@        PJ                  08w  gi   V!\@        PJ                  ,          PQ                  4       '       g>   V"^8w  g7   \	        R;VPM                  V4       R<V!\@        PJ                  ,           R=24      hMV'       g   Vf   \        VPL                  PL                  4      p(V(PS                  R>4      '       gT   V(PU                  R?4      '       g=   VP                  PV                  '       d0   VP                  PY                  4       '       g   \	        R@V( RA24      h\G        VPM                  V4      R	\Z        RB7      V!\@        PJ                  &   V! U)u. uF[  p)V)\@        P\                  8X  gB   V)\@        P^                  8X  g-   V)\@        PJ                  8X  g   V)\@        P`                  8X  g   KY  V)NK]  	  p*p)\7        V*4      ^8:  gF   \7        V*4      ^8X  d+   \@        P^                  V*9  d   \@        P`                  V*9   g   \	        RC4      hVP                  RDRE4      p+\        V+\        4      '       g   \	        RFV+ 24      hV+RE8X  d   . M3V+P!                  R4       U,u. uF  p,\0        P                  V,4      NK  	  up,p-VP                  RG/ 4      p./ p/\        V.\        4      '       d7   \b        P                  V.\d        Pf                  4      V/\d        Pf                  &   M\        V.\<        4      '       d   V.P?                  4        F  w  p%p0V%R.8X  d   K  \        V%\        4      '       g   \	        RHV% 24      h\        V0\        4      '       g   \	        RIV0 24      h\d        P                  V%4      p1\b        P                  V0V14      V/V1&   K  	  M\	        RJV. 24      hV/'       dd   V'       g   \	        RK4      h^ RI4H5u H6p2 \n         F=  p&V&V!9   d   \	        RLV& 24      h\G        V2Pq                  VV&4      R\Z        R97      V!V&&   K?  	  V'       d   Rp3MV!PO                  4       \@        PJ                  08g  ;'       d\    V!PO                  4       \@        P`                  08g  ;'       d2    V!PO                  4       \@        PJ                  \@        P`                  08g  p3\@        PJ                  V!9   p4\@        P`                  V!9   p5\@        P\                  V!9   p6\@        P^                  V!9   p7V!P?                  4        U%Uu/ uF  w  p%pV%VPL                  V/bK  	  p8p%pVP                  R.R4       V'       d   \	        RMV 24      hVe$   \r         F  p9V9V!9   g   K  \	        RNV9 RO24      h	  \u        RW/ RVbRVbRVbRVbRVbRVbR#VbRDV-bRGV/bRVbRVbR VbR"VbRVbRVbRPVbRV
bRQV3bRRV4bRSV5bRTV6bRUV7bR%VbRVVb V83# u up)i u up,i u upp%i )XzX
Parse a NativeFunction from a dictionary as directly parsed
from native_functions.yaml
rS  znot a str: )namespaced_entity	max_levelaten)defaultre  z#cpp_no_default_args is not a list: rT  Fz1use_const_ref_for_mutable_tensors is not a bool: z4see https://github.com/pytorch/pytorch/issues/145522rZ  r-   zvariants is not a str: r  r.   zillegal variant r[  znot a bool: r\  rU  TrV  Nzillegal device_check: r`  ra  ::zbnamespace is not supported in structured delegate, using the same namespace as the native functionrb  zbnamespace is not supported in structured inherits, using the same namespace as the native functionrX  z&functions in modules cannot be methodsrY  rc  z5precomputed requires structured=True, got structured=rk  ztags is not a list: pt2_compliant_tagzvalid_tags is emptyzillegal tag )cppdispatchzdispatch is not a dict: zncannot specify both manual_kernel_registration and dispatch; with manual registration, dispatch has no effect!__line__zillegal dispatch key 'z' in zillegal dispatch value ',zDispatch key z of kernel z! is not a supported dispatch key.)rs  atz::native)kernelr`  cpp_namespacezSunnecessary dispatch table for this function; just delete the dispatch key entirelyzQunexpected name for singleton CompositeImplicitAutograd dispatch entry: expected z	 but got zR.  Rename your implementation to the expected name, then delete the dispatch tablenew__likez	expected z to have a CompositeExplicitAutograd dispatch entry, but there was no dispatch table.  Factory functions should not have implicit dispatch as they should not be decomposed for __torch_dispatch__)r`  r~  aH  cannot specify more than one of CompositeExplicitAutograd, CompositeExplicitAutogradNonFunctional, or CompositeImplicitAutograd on a single kernel; each strictly subsumes the other.  If you wanted to provide an explicit autograd implementation, specify CompositeExplicitAutograd; otherwise specify CompositeImplicitAutograd onlyr^   zautogen is not a str: r_  z#ufunc_inner_loop key is not a str: z%ufunc_inner_loop value is not a str: z"ufunc_inner_loop not str or dict: zufunc must be structuredz2ufunc should not have explicit dispatch entry for zleftover entries: z+if structured_delegate, then must not have z* in dispatch dictionary (it is delegated!)r]  rf  rg  rh  ri  rj  rQ  r   );copypop
isinstancer   rG   r	   from_namespaced_entityget_cpp_namespacerR  rK   entity_namelistsetr   	argumentsoutr  r  r,   r-   r.   rG  rE   rI  OperatorName
Precomputeappendlentorchgen.apirx  dictrF   r4   stripdispatch_keysBackendMetadatar   rx   r;   keyssupports_symint
startswithendswithtensor_optionshas_tensor_argDEFAULT_KERNEL_NAMESPACErz   r{   ry   UfuncInnerLoopr7  rE  torchgen.api.ufuncapiufuncr   schema_kernel_namer   rP  ):rm  r]  rn  ro  efuncsnamespace_helperrQ  rS  cpp_no_default_args_listre  rT  
variants_srZ  rJ   r[  r\  rU  device_check_srV  r`  structured_delegate_sra  rb  rX  rY  precomputed_dictrc  tags_inprk  trx  raw_dispatchry  num_dispatch_keys%redundant_composite_implicit_autogradksrI   dispatch_keykernel_namespacer;   dcomposites_in_dispatchautogen_strxr^  raw_ufunc_inner_loopr_  vo	ufunc_keyr  rf  rg  rh  ri  rj  backend_metadatakeys:   &&&&                                                      r   	from_yamlNativeFunction.from_yamlo  s    GGIf%%% ;ug!677*AA#q
 %66v6F	##$4$@$@A#$55)>#C 2D99 56N5OP  "":;,-EE/-
) ;TBB CDeCfg  -~~!!!$J  UU:z2
*c** #::,!GHH!$!!$'AJW--.hW^^,$'7s%;<< ( &'UU+G%O"4d;; <0J/K!LMMUU#7?,d33 <0B/C!DEEuu^T2,-- <~!>??~t4&*^S*I*I ;~.>!?@@"n8S8S&S #9.9I!JKK!*44L*>:LUU</
*d++ <
|!<== !&;T B!)Z8Ms-S-S ;/D.E!FGG ,9N1N C  48 ,"."4"45J"Kee$94@#+z:Ms/S/S ;/B.C!DEE*t7J/J C 
 ot4%M3)G)G ;}o!>??$8)C !IJJEE"5t<!)Z8I3-O-O ;/@.A!BCC555'Jd,B G
|T  =Mj&&'78RV55$h$$ zH(D)) #7z!BCC #6*#DOO/0A:!#$%:;;J$|A3%788  	%uuZ.$
<(F(F #;A3!?@@79!"#)$C  5:1%++-A#!"c**(0E,H  "!S))(21#U<.I  #A#.#4#4QWWY#?L%*%"|{'B #=8,+L>QC H? ?  (7'M'MQ($ (8'I'IRV'I'W$ .=/;;#- $E $E6|D'7*'D	.H\* %(M(MM$/@D== ' .\ !A%*O$#  $==?{'L'L&MMKAABRRTT$)$ghkhphpquhvgw x'(M(MNO P;; 
  3 ;tyy~~&D''==)) NN111 NN99;; %v &- -  ?N5@X?H[::; "
K999KFFFK999KEEE A 	 "
 &'1,*+q0FF12  EE-.
 !v  eeIr*+s++ #9+!GHH b  1<1B1B41HI1HA,$$Q'1HI 	  !uu%7<*C001?1E1E$h&6&62X--. ,d33-3352
?!!S))(+Nqc)RSS!"c**(+PQSPT)UVV$NN1-	.<.B.B2y.Q + 6 !45I4JK  $%?@@ /. 38+(L\N[  *9 33D,G#":*& !4 K K$I$I#JJ  MMOEEFG  MMO99EE	  11X= 	/ ==I 	= 11X= 	/ >>(J 	> ;C..:JK:J$!QA		1~-:JK 	
j$ #5aS!9:: */(?(EcU K- -  0  2S " &	
 %8 %8 (   "2 ,F $6 , #4 * *  !" %8#$ (%& 8^'( Fz)* 8^+, G|-. /0 $14 7
 	
A"
H JV Ls   =Au u u% u*c                   V ^8  d   QhRR/# r   r   Noner   )r   s   "r   r   rp    s      t r   c                	z    V P                   '       d   \        R 4      hV P                  '       g   \        R4      hR# )zMThis function is structured, but there was no valid functional variant of it.zThis function delegates to another structured out function, but no valid function was found (the delegate may not exist, or it has the wrong type)N)r`  rG   ra  r!   s   &r   validate_unstructured$NativeFunction.validate_unstructured  sE     ??? 5  ''' i  (r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rp    s     I It Ir   c                	   V P                   P                  P                  '       d,   V P                  \        P
                  08w  d   \        R 4      hV P                  '       dV   V P                   P                  4       \        P                  8w  d   \        R4      hV P                  '       g   \        R4      hV P                  '       dV   V P                   P                  4       \        P                  8X  d   \        R4      hV P                  '       g   \        R4      hV P                  '       d   V P                  '       d   \        R4      hV P                   P                  4        Uu0 uF  qP                  f   K  VP                  kK   	  pp\        P!                  V P"                  V4      p\%        V4      ^ 8w  d   \        RV 24      hV P&                  e   V P                  '       g   \        R4      h\)        V P                   P                  4      P+                  R4      '       d+   V P,                  \.        P0                  8w  d   \        R	4      hR
\)        V P                   P                  4      9   Eg   R\)        V P                   P                  4      9   gw   \2        ;QJ d:    R V P                   P                  P4                   4       F  '       g   K   RM/	  RM+! R V P                   P                  P4                   4       4      '       dS   R\)        V P                   P                  4      9  d/   \)        V P                   P                  P                  4      R8w  g+   V P                   P                  P7                  4       '       d6   RV P8                  9  d#   \        RV P                   P                   24      hR# R# u upi )zNative functions with out arguments MUST be declared with only function variant; e.g., variants: function; otherwise you will tickle a Python argument binding bug (which usually manifests itself as the result variable being undefined.)zYPut structured field on the out= variant of a function; did you mean structured_delegate?z:device_guard: False is not respected by structured kernelszQstructured_delegate field not allowed on out= functions; did you mean structured?z?Cannot have both structured and structured_delegate on functionNzInvalid cpp_no_default_args: z4structured_inherits must also imply structured: True_foreachzsforeach kernels fall back to slow path when tensor are on different devices, device_check not allowed to be enabledranddropoutc              3  @   "   T F  pR VP                   9   x  K  	  R# 5i)r  Nr:   r   args   & r   r   /NativeFunction.__post_init__.<locals>.<genexpr>R  s      9U#	SXX-9Us   TFbackward_cudnn_init_dropout_statenondeterministic_seededz(nondeterministic_seeded tag missing for )rS  r  r  rZ  r,   r-   rG   r`  kind
SchemaKindrU  ra  schema_order_argumentsru  r;   r  
differencere  r  rb  r   r  rV  rG  rH  anyflat_allhas_generator_argrk  )r"   adefaulted_argumentsinvalid_argss   &   r   __post_init__NativeFunction.__post_init__  s   99"""}}!1!1 22$_  ???yy~~:>>1$O  $$$$P  ###yy~~:>>1$B  $$$$P 
 ???t777 Q  !II<<>
>q))FAFF> 	 
 ~~d&>&>@ST|! #@!OPP##/???$J  tyy~~))*55  O$;$;;$=  c$))..)) TYY^^!44s 9=9L9L9U9Usss 9=9L9L9U9U  
 c$))..&99		++,0KKyy""4466(		9$>tyy~~>NO  : 7C
s   +O
?O
c                   V ^8  d   QhRR/# r   r   r   r   )r   s   "r   r   rp  b  s     
 
d 
r   c                	    V P                   ;'       gJ    V P                   ;'       g5    V P                  ;'       g!    V P                   ;'       d    V P                  # r9   )rg  ri  rj  rh  r!   s   &r   has_composite_kernel#NativeFunction.has_composite_kernela  sj     77
J::J
JII
 

 77 J JII	
r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rp  m  s     K KD Kr   c                	|   V P                   P                  p\        V4      ^ 8  ;'       d5    \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      pRV P                  9   ;'       dM    \        V P                   P                  4      R8g  ;'       d#    \        V P                   P                  4      R8g  p\        ;QJ d4    R V P                   P                  4        4       F  '       g   K   RM)	  RM%! R V P                   P                  4        4       4      pT;'       g    T;'       g    T# )r   c              3     "   T F5  qP                   R J;'       d    VP                   P                  '       * x  K7  	  R # 5ir9   
annotationis_writer   r   s   & r   r   ,NativeFunction.is_view_op.<locals>.<genexpr>o  s2      5
LPqLL$BBQ\\-B-B)BBDs   ?$?TFinplace_viewresize_
resize_as_c              3     "   T F4  pVP                   R J;'       d    RVP                   P                  9   x  K6  	  R # 5i)N*)r  alias_set_after)r   inps   & r   r   r  x  s:      
9 NN$&PP3#..2P2P+PP9s   >">)rS  returnsr  r  rk  r   r;   r  )r"   retsis_non_mutating_viewis_inplace_viewis_wildcard_views   &    r   
is_view_opNativeFunction.is_view_opl  s   yy  "4y1}  
  
 5
LP5
 5
LP5
 2

 dii' 4 4DIINN#y04 4DIINN#|3 	
 3 
yy779
333 
yy779
 
 $JJJJ:JJr   c                   V ^8  d   QhRR/# )r   r   rK  r   )r   s   "r   r   rp    s     / /. /r   c                	p   V P                   '       dt   V P                  P                  P                  P                  '       dD   R V P                  9  d#   \        RV P                  P                   24      h\        P                  # V P                   '       d   \        P                  # \        P                  # )r  zinplace_view tag missing for )
r  rS  r;   inplacerk  rG   rK  rM  rL  rN  r!   s   &r   view_schema_kindNativeFunction.view_schema_kind~  sy    ???tyy~~22:::TYY.$'DTYY^^DT%UVV!222???!***!...r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rp    s     ( (3 (r   c                	V    V P                   P                  P                  P                  # r9   )rS  r;   baser!   s   &r   	root_nameNativeFunction.root_name  s    yy~~""'''r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rp    s     G G$ Gr   c                	F    V P                   ;'       g    V P                  R J# r9   )r`  ra  r!   s   &r   part_of_structured_group'NativeFunction.part_of_structured_group  s    FF$":":$"FFr   r   r9   )r%   r&   r'   r(   r)   r   r  r  r  propertyr  r  r  r  r  r*   r   r   r   rP  rP    sD    N  (,+  "!  "! 
 !%$  
M   54  -, $# #" "!  -10:>>,00;?? N O
 O
b*IV 
 
 K K" / / ( ( G Gr   rP  c                  \    ] tR tRt]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t	Rt
R# )r  i  r   N)r%   r&   r'   r(   r   
functionalr  r  mutablescratchr*   r   r   r   r  r    s%    JfG
&CfGfGr   r  c                      ] tR tRt$ R]R&   R]R&   R]R&   R]R&   ]R R	 l4       tR
 R ltR R ltR R lt	]R R l4       t
]R R l4       tRtR# )NativeFunctionsGroupi  rP  r  NativeFunction | Noner  r  r  c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   !NativeFunctionsGroup.__annotate__  s     # #D #r   c                	.    V P                   P                  # r9   )r  r`  r!   s   &r   r`  NativeFunctionsGroup.structured  s     xx"""r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r    s     ] ]t ]r   c           
     	   V P                   P                  P                  4       pV P                  4        F  pWP                  P                  4       8w  d*   \	        R V RVP                  P                  4        24      hV P
                  VP                  8w  g   Kg  \	        RV P                  P                  P                   RVP                  P                   24      h	  V P                   P                  P                  4       \        P                   8w  d2   \	        RV P                   P                  P                  4        R24      hV P                  P                  P                  4       \        P                  8w  d2   \	        RV P                  P                  P                  4        R24      hV P                   P                  V P                  P                  8w  d;   \	        RV P                   P                   R	V P                  P                   R
24      hV P                  e   V P                  P                  P                  4       \        P                  8w  d2   \	        RV P                  P                  P                  4        R24      hV P                  P                  V P                   P                  8w  d;   \	        RV P                  P                   RV P                   P                   R
24      hV P                  Ee   V P                  P                  P                  4       \        P                  8w  d2   \	        RV P                  P                  P                  4        R24      hV P                  P                  V P                   P                  8w  d;   \	        RV P                  P                   RV P                   P                   R
24      hV P                   P                  P                  P                  P                  '       g   \	        R4      hV P
                  '       Ed   V P                  P                  '       g   V P                  P                   '       d   \	        R4      hV P                   P"                  V P                  P                  P                  8w  dd   \	        V P                   P                  P                   RV P                   P"                   RV P                  P                  P                   24      hV P                  e   V P                  P"                  V P                  P                  P                  8w  dd   \	        V P                  P                  P                   RV P                  P"                   RV P                  P                  P                   24      h\%        V P                  4        Uu. uF5  pRVP&                  9   g   K  \)        VP                  P                  4      NK7  	  up4      pRP+                  R V 4       4      p\-        4       pV P                  4        F%  pVP/                  R VP0                   4       4       K'  	  RP+                  R \%        V4       4       4      p\3        V4      ^ 8X  dB   \3        V4      ^ 8  d2   \5        RV RV R\)        XP                  P                  4       24      hWd8w  d   \5        RV RV R V R!24      hR# u upi )"z_NativeFunctionsGroup constructed from two NativeFunctions that don't have matching signatures:  != zMNativeFunctionsGroup constructed from structured and unstructured functions:  and zfunctional.func.kind() is z , expected SchemaKind.functionalzout.func.kind() is z, expected SchemaKind.outzfunctional.namespace (z) != out.namespace ()Nzinplace.func.kind() is z, expected SchemaKind.inplacezinplace.namespace (z) != functional.namespace (zmutable.func.kind() is z, expected SchemaKind.mutablezmutable.namespace (zSfunctional.func.name.name.functional_overload must be True when mutable is not Nonez.structured composite kernels are not supportedz delegates to z but its actual delegate is 	generatedr  c              3  8   "   T F  p\        V4      x  K  	  R # 5ir9   r   r   r  s   & r   r   5NativeFunctionsGroup.__post_init__.<locals>.<genexpr>  s     %Dmc!ffm   c              3  8   "   T F  p\        V4      x  K  	  R # 5ir9   r  )r   ops   & r   r   r    s     )FIb#b''Ir  c              3  8   "   T F  p\        V4      x  K  	  R # 5ir9   r  r  s   & r   r   r    s      /
:qCFF:r  z,The codegen expects to be able to generate 'zv'. In order to generate them however, we expect them to be called out explicitly in the yaml. Please add an 'autogen: z' line to the entry for z*'. To do so, it expects a line: 'autogen: z'. Instead, it found 'autogen: ')r  rS  	signature	functionsrG   r`  r  r  r;   r  r  rQ  r  r  functional_overloadrg  rh  ra  sortedrk  r   r   r  r  r^  r  RuntimeError)r"   test_sigfgenerated_fnsgenerated_fns_strexpected_generated_fnsexpected_generated_fns_strs   &      r   r  "NativeFunctionsGroup.__post_init__  s   #'??#7#7#A#A#C!A66++--$<<D:T!&&JZJZJ\I]_ 
 !"<"<<$""&((--"4"4!5U166;;-I  " ??$$&**?*?? ,T__-A-A-F-F-H,IIij  88==:>>1 %dhhmm&8&8&:%;;TU  ??$$(:(:: ()B)B(CCWX\X`X`XjXjWkklm  <<#||  %%':+=+==$-dll.?.?.D.D.F-GGde  ||%%)B)BB$)$,,*@*@)AA\]a]l]l]v]v\wwxy  <<#||  %%':+=+==$-dll.?.?.D.D.F-GGde  ||%%)B)BB$)$,,*@*@)AA\]a]l]l]v]v\wwxy  ??'',,11EEE$i  ??? ???88PPP$%UVV22dhhmm6H6HH$++001@c@c?d e226((--2D2D1EG  ||'<<33txx}}7I7II(<<,,112.AaAa@b c66:hhmm6H6H5IK 
 '+~~'7Q'7!;!&&;PS'7Q
 !II%Dm%DD+.5!A")))FAII)FF "%)YY /
"#9:/
 &
" %&!+M0BQ0F>?P>Q R,,=+>>VWZ[\[a[a[f[fWgVhj 
 &:>?P>Q R;;L:M N00J/K1N  ; Rs   [=)#[=c                   V ^8  d   QhRR/# r   r   rR  r   )r   s   "r   r   r    s     ) )> )r   c                	J    V P                   P                  P                  4       # r9   )r  rS  r  r!   s   &r   r  NativeFunctionsGroup.signature  s    xx}}&&((r   c                   V ^8  d   QhRR/# )r   r   Iterator[NativeFunction]r   )r   s   "r   r   r    s      3 r   c              #  	   "   V P                   x  V P                  x  V P                  e   V P                  x  V P                  e   V P                  x  R # R # 5ir9   )r  r  r  r  r!   s   &r   r  NativeFunctionsGroup.functions  sE     oohh<<#,,<<#,, $s   AAc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     ) )3 )r   c                	.    V P                   P                  # r9   )r  r  r!   s   &r   r  NativeFunctionsGroup.root_name  s    (((r   c                    V ^8  d   QhRRRR/# )r   r  z dict[SchemaKind, NativeFunction]r   zNativeFunctionsGroup | Noner   )r   s   "r   r   r    s     
 
5 
:U 
r   c                	   V '       g   \        R 4      h\        V 4      ^8X  d   R# \        V 4      p V P                  \        P
                  R4      pV P                  \        P                  R4      pV P                  \        P                  R4      pV P                  \        P                  R4      pV '       d   \        RV  24      hVf   \        R4      hVf   R# \        VVVVR7      # )z from_dict called with empty dictNzunexpected keys in dict: zfunctional variant is required)r  r  r  r  )
rG   r  r  r  r  r  r  r  r  r	  )r  r  r  r  r  s   &    r   	from_dictNativeFunctionsGroup.from_dict  s     !CDDq6Q;GUU:00$7
%%
**D1%%
**D1eeJNND) #<QC!@AA !ABB ;#!	
 	
r   r   N)r%   r&   r'   r(   r)   r  r`  r  r  r  r  r   r7  r*   r   r   r   r	  r	    se    """"	# #]~) ) ) 
 
r   r	  c                  B    ] tR tRt$ R]R&   R]R&   R]R&   R R ltR	tR
# )r  i6  r   r}  r   r`  r~  c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   BackendMetadata.__annotate__I  s     ( ( (r   c                	     R V P                   9   # )_symint)r}  r!   s   &r   r  BackendMetadata.supports_symintI  s    DKK''r   r   N)r%   r&   r'   r(   r)   r  r*   r   r   r   r  r  6  s#     K
  ( (r   r  c                  L    ] tR tRt$ R]R&   R]R&   R]R&   ]R R	 l4       tR
tR# )r  iM  r   r;   r  supported_dtypesr7  r  c               $    V ^8  d   QhRRRRRR/# )r   rC   r   r  r7  r   r  r   )r   s   "r   r   UfuncInnerLoop.__annotate__V  s!     
 
S 
X 
. 
r   c                	6   V P                  R ^4      w  r#V^ ,          R8w  d   \        RV 24      hVR,          R8w  d   \        RV 24      h\        4       pV^R P                  R4       F  pV\        P	                  V4      ,          pK!  	  \        W$VR7      # ) (z0expected '(' at start of supported_dtypes, got: r  z.expected ')' at end of supported_dtypes, got: r  )r;   r@  r  )r  rG   r
   r  r  r  )rC   r  r;   supported_dtypes_strr@  rI   s   &&    r   rK   UfuncInnerLoop.parseU  s    %*[[a%8""c) BCWBXY   #s* @AU@VW  4><%a+11$7A
 4 4Q 77 8I
 	
r   r   N)r%   r&   r'   r(   r)   r   rK   r*   r   r   r   r  r  M  s'    
I,, 
 
r   r  c                      ] tR tRt$ R]R&   R]R&   R]R&   R]R&   R]R	&   ]R
 R l4       tR R ltR R ltR R lt	R R lt
RtR# )BackendIndexio  r4   r  r   use_out_as_primaryrU  externalz#dict[OperatorName, BackendMetadata]indexc               $    V ^8  d   QhRRRRRR/# )r   parent_indexz6dict[DispatchKey, dict[OperatorName, BackendMetadata]]child_indexr   r  r   )r   s   "r   r   BackendIndex.__annotate__  s&     
4 
4L
4K
4 

4r   c                	    VP                  4        FG  w  r#VP                  4        F.  w  rEW@V,          9   d   \        R V RV 24      hWPV,          V&   K0  	  KI  	  R# )zduplicate operator z for dispatch key N)rF   rG   )rO  rP  rI   rJ   op_namemetadatas   &&    r   
grow_indexBackendIndex.grow_index~  sb    
  %%'DA%&WWY!1o-(-gY6HL  ,4Q( &/ (r   c                    V ^8  d   QhRRRR/# )r   gr	  r   rP  r   )r   s   "r   r   rQ    s        -  .  r   c                	V    V P                   '       d   VP                  # VP                  # r9   )rK  r  r  )r"   rX  s   &&r   primaryBackendIndex.primary  s!    """55L<<r   c                    V ^8  d   QhRRRR/# )r   rX  %NativeFunction | NativeFunctionsGroupr   r   r   )r   s   "r   r   rQ    s      A d r   c                	,    V P                  V4      pVR J# r9   )
get_kernel)r"   rX  ms   && r   
has_kernelBackendIndex.has_kernel  s    OOA}r   c                    V ^8  d   QhRRRR/# )r   rX  r]  r   zBackendMetadata | Noner   )r   s   "r   r   rQ    s     ' '6'	'r   c                	6   \        V\        4      '       d   TpM3\        V\        4      '       d   V P                  V4      pM\	        V4       XP
                  P                  V P                  9  d   R # V P                  VP
                  P                  ,          # r9   )r  rP  r	  rZ  r   rS  r;   rM  )r"   rX  r$  s   && r   r_  BackendIndex.get_kernel  sf     a((A/00QAO66;;djj(zz!&&++&&r   c                   V ^8  d   QhRR/# )r   r   rW  r   )r   s   "r   r   rQ    s      J r   c                	Z    V P                   '       d   \        V P                  4       R 2# R# )NativeFunctionsN)rL  r   r  r!   s   &r   native_function_class_name'BackendIndex.native_function_class_name  s)    ===$++,-_==
 r   r   N)r%   r&   r'   r(   r)   r   rU  rZ  ra  r_  ri  r*   r   r   r   rJ  rJ  o  sN      N..
4 
4 ' r   rJ  c                  <   ] tR tRt$ R]R&   R]R&   R]R&   ]R R	 l4       tR
 R lt]P                  ! R4      t
]R R l4       tR R ltR R ltR R ltR R ltR R ltR R ltRRRRRR/R R  lltR! R" ltR# R$ lt]R% R& l4       tR' R( ltR) R* ltR+tR,# )-rR  i  r  r;   	Argumentsr  tuple[Return, ...]r  c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   FunctionSchema.__annotate__  s     A AD Ar   c                	   a R  R lo\         ;QJ d3    V3R lV P                  P                   4       F  '       g   K   R# 	  R# ! V3R lV P                  P                   4       4      # )c                    V ^8  d   QhRRRR/# )r   r  Argumentr   r   r   )r   s   "r   r   /FunctionSchema.is_mutable.<locals>.__annotate__  s     	+ 	+( 	+t 	+r   c                N    V P                   f   R# V P                   P                  # )NFr  )r  s   &r   r  +FunctionSchema.is_mutable.<locals>.is_write  s    ~~%>>***r   c              3  4   <"   T F  pS! V4      x  K  	  R # 5ir9   r   )r   r  r  s   & r   r   ,FunctionSchema.is_mutable.<locals>.<genexpr>  s     @(?18A;;(?r   TF)r  r  r  )r"   r  s   &@r   
is_mutableFunctionSchema.is_mutable  sG    	+ s@(?(?@ss@s@s@(?(?@@@r   c                   V ^8  d   QhRR/# )r   r   zIterator[Argument]r   )r   s   "r   r   ro    s     
 
(: 
r   c                	    \         P                  ! V P                  P                  V P                  P                  V P                  P
                  4      # r9   )	itertoolschainr  flat_positionalflat_kwarg_onlyr  r!   s   &r   r  %FunctionSchema.schema_order_arguments  s:    NN**NN**NN
 	
r   z3(?P<name>[^\(]+)\((?P<args>.*)\) -> (?P<returns>.*)c                    V ^8  d   QhRRRR/# )r   rS  r   r   rR  r   )r   s   "r   r   ro     s      C N r   c                	n   \         P                  P                  V 4      p\        V4      ^8w  d   \	        RV  24      hV^ ,          w  r#p\
        P                  V4      p\        P                  V4      p\        V4      p\        WVVR7      p\        V4      V 8w  d   \	        \        V4       RV  24      hV# )   zInvalid function schema: r;   r  r  r  )
rR  decl_refindallr  rG   r  rK   rl  parse_returnsr   )	rS  declsopsargsreturn_declr;   r  r  r   s	   &        r   rK   FunctionSchema.parse  s     &&..t4u:? #<TF!CDD!&q;!!#&OOD)	,7Kq6T> CF84v!677r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   ro    s     
 
T 
r   c                	    \         ;QJ d&    R  V P                   4       F  '       g   K   R# 	  R# ! R  V P                   4       4      # )c              3     "   T F5  pVP                   f   K  VP                   P                  '       g   K1  Vx  K7  	  R # 5ir9   r  r  s   & r   r   5FunctionSchema.returns_are_aliased.<locals>.<genexpr>  s2      
!|| ,-LL,A,A A!s   ??
?TF)r  r  r!   s   &r   returns_are_aliased"FunctionSchema.returns_are_aliased  sE    s 
\\
ss 	
s 	
s 
\\
 
 	
r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   ro    s     t tt tr   c                	  aa \        V P                  P                  V P                  4       FF  w  poVP                  SP                  8w  g   K#  \        R VP                   RSP                   24      h	  V P                  P                   Fn  o\        ;QJ d)    V3R lV P                   4       F  '       g   K   RM	  RM! V3R lV P                   4       4      '       g   KY  \        R\        V 4       24      h	  \        V P                  P                  4      V P                  P                   Uu. uF  qP                  R8X  g   K  VNK  	  up,           pV P                   Uu. uF3  pVP                  f   K  VP                  P                  '       g   K1  VNK5  	  ppV P                   Uu. uF1  pVP                  e   VP                  P                  '       d   K/  VNK3  	  pp\        V4      ^ 8X  g(   \        V4      ^ 8X  g   \        R\        V 4       24      hV FN  o\        ;QJ d    V3R	 lV 4       F  '       g   K   RM	  RM! V3R	 lV 4       4      '       d   KE  \        R
4      h	  V P                  P                  '       Ed   \        ;QJ d0    R V P                  P                   4       F  '       g   K   RM%	  RM!! R V P                  P                   4       4      '       d'   \        V P                  4      ^ 8w  d   \        R4      hM\        V P                  P                   Uu. uF(  pVP                  P                  R4      '       d   K&  VNK*  	  up4      pV\        V P                  4      8w  d&   \        RV R\        V P                  4       R24      hV P                  P                  P                  '       EdI   V P                  P                   pV'       dC   VP"                  P                  '       d'   VP"                  P                  P                  '       g   \        RV P                   R24      hVP"                  P$                  \'        \(        P*                  4      8X  dk   \        V P                  4      ^8X  d7   V P                  ^ ,          P                  VP"                  P                  8X  g   \        RV P                   R24      hM3\        V P                  4      ^ 8w  d   \        RV P                   R24      hV P                  P,                  e;   V P/                  4       \0        P2                  8w  d   \        R\        V 4       24      hV P5                  4       '       d=   V P/                  4       \0        P2                  8w  d   \        R\        V 4       24      hR# R# u upi u upi u upi u upi )zOut arguments must have matching return Tensor; furthermore, the ith-argument needs to correspond to the ith return. arg.annotation=z, ret.annotation=c              3  V   <"   T F  pSP                   VP                   8H  x  K   	  R # 5ir9   r  r   r   r  s   & r   r   /FunctionSchema.__post_init__.<locals>.<genexpr>!  s     FA1<<1<</   &)TFz^If you have a schema with mutable positional args, we expect them to not be returned. schema: r"   NzYNativeFunctions must have either only mutable returns, or only immutable returns. Found: c              3  V   <"   T F  pSP                   VP                   8H  x  K   	  R # 5ir9   r  )r   r  rets   & r   r   r  @  s     P<Cs~~7<r  zAll mutable returns must be aliased either to a keyword argument, or to "self". Did you forget to mark an out argument as keyword-only?c              3  l   "   T F*  qP                   \        \        P                  4      8g  x  K,  	  R # 5ir9   )typeBaseTypeBaseTyTensorr   r  s   & r   r   r  K  s"     Q>P66Xfmm44>Ps   24zout= ops that accept tensor lists as out arguments are expected to have no return type (since you can't do method chaining on them)	_scratch_zSMust return as many arguments as there are out arguments, or no return at all. Got z non-scratch out args and z returnszInplace op z4 must have a self argument with a mutable annotationz" with Tensor self must return selfz* with non-Tensor self must have no returnszFound an operator that is not functional or out variant, but has tensor options arguments.This is not allowed- tensor options arguments are only allowed for factory functions.schema: zFound an operator that is not functional, but its overload contains the string 'functional'.This is a special keyword in the codegen, please use a different overload name.schema: )zipr  r  r  r  rG   post_self_positional_mutabler  r   r  r~  r;   r  r  r  r  self_argargumentr  r  r  r  r  r  r  r  is_functional_fn)	r"   r  out_and_selfr  mutable_returnsimmutable_returnsnon_scratch_out_argsself_ar  s	   &  `    @r   r  FunctionSchema.__post_init__  s   DNN..=HC~~/$&&)nn%55Fs~~FVX  > <<AsFFsssFFFF$tuxy}u~t  A  = DNN../>>993
9CXX=OCC93
 

 ||
#~~ .1nn.E.E C# 	 
 ||
#~~%S^^-D-D C# 	 
 O$)S1B-Cq-H kloptlukvw  #C3P<P333P<PPP$N  # >> sQdnn>P>PQsssQdnn>P>PQQQt||$)(k  * (+ $(>>#5#5#5C"xx22;? #5($ (3t||+<<(344NsSWS_S_O`Naaik 
 99>>!!!^^,,FOO...OO..777$!$)),`a  ##x'>> %*Q22foo6P6PP(%dii[0RS  Q t||$)(%dii[0Z[  >>((4yy{j333$"4yk+ 
   ""yy{j333$"4yk+  4 #w3



Hs6   5WW)W>WW2,W#W8#W Wc                   V ^8  d   QhRR/# r  r   )r   s   "r   r   ro    s     7 7$ 7r   c                	4    R V P                   P                  9   # )r  r;   overload_namer!   s   &r   r  FunctionSchema.is_functional_fn  s    tyy6666r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   ro    s     ( (4 (r   c                	@    \        V P                  P                  4      # r9   )r   r  r  r!   s   &r   	is_out_fnFunctionSchema.is_out_fn  s    6 DNN&&''r   c                   V ^8  d   QhRR/# )r   r   r  r   )r   s   "r   r   ro    s     *) *)j *)r   c                F   \        V P                  P                  4      p\        V P                  P                   Uu. uF'  q"P                  P	                  R4      '       g   K%  VNK)  	  up4      pV P                  P                  P
                  p\        ;QJ d0    R V P                  P                   4       F  '       g   K   RM%	  RM!! R V P                  P                   4       4      pV'       d   V'       d   \        R4      hV'       d   \        P
                  # V'       d$   V'       g   \        R4      h\        P                  # V'       d$   V'       d   \        R4      h\        P                  # V'       d   \        P                  # \        P                  # u upi )z
What kind of schema is this?  A functional schema is one
that returns a newly allocated output; an inplace schema
modifies the self argument inplace; an out schema writes
the result into an explicitly provided out argument.
r  c              3  z   "   T F1  pVP                   R J;'       d    VP                   P                  x  K3  	  R # 5ir9   r  r  s   & r   r   &FunctionSchema.kind.<locals>.<genexpr>  s5      
8 LL$>>)>)>>8s   ;;TFz(A schema cannot be both out= and inplacezFinvariant: all scratch operators are expected to be out= operators toozjWe should not categorize a scratch op as an out variant. Check if the order of if statements are expected!)r   r  r  r;   r  r  r  post_self_positionalrG   r  r  r  r  )r"   is_outr  
is_scratch
is_inplacerx  s   &     r   r  FunctionSchema.kind  s5    dnn(() NN..S.S((2E2Ek2RSS.S

 YY^^++
S 
^^88
SSS 
^^88
 

 j !KLL %%%$\  %%%$ A  >>!%%%(((C Ts   "F$Fc                   V ^8  d   QhRR/# )r   r   zlist[str | None]r   )r   s   "r   r   ro    s      &6 r   c                	   . pV P                    F  pV P                  P                   Uu. uF2  pVP                  f   K  VP                  VP                  8X  g   K0  VNK4  	  pp\	        V4      ^ 8X  d   VP                  R 4       Kx  \	        V4      ^8X  d%   VP                  V^ ,          P                  4       K  RP                  R V 4       4      p\        RVP                   RV R24      h	  V# u upi )Nr  c              3  8   "   T F  qP                   x  K  	  R # 5ir9   r:   r  s   & r   r   6FunctionSchema.aliased_return_names.<locals>.<genexpr>  s     )G,Q&&,r  zFound a return (z)that aliases multiple inputs (r  )	r  r  r  r  r  r  r;   r   rG   )r"   outsr   r  aliased_argsaliased_namess   &     r   aliased_return_names#FunctionSchema.aliased_return_names  s    !#A 000A<< 010L 0  
 < A%D!\"a'LO001 $		)G,)G G$&qvvh.Mm_\]^   s   C3C3C3strip_defaultFstrip_view_copy_namekeep_return_namesc               (    V ^8  d   QhRRRRRRRR/# )r   r  r   r  r  r   rR  r   )r   s   "r   r   ro    s:     g
 g
 g
 #	g

  g
 
g
r   c          
       a a R V3R llpS P                   P                   P                  pV'       dT   VP                  R4      '       d   VP                  RR4      pM)VP                  R4      '       d   VP                  RR4      p\        ;QJ d    . VV 3R l\
        P                  ! S P                  P                  e"   S P                  P                  P                  .M. S P                  P                  S P                  P                  4       4       F  NK  	  5M! VV 3R l\
        P                  ! S P                  P                  e"   S P                  P                  P                  .M. S P                  P                  S P                  P                  4       4       4      p\	        \        VS P                  4      4      pWv,           pS P                  P                  VR	7      p	\        S P                   4      R
8X  d/   \         P#                  \        V	4      P                  RR4      4      p	\%        \'        \)        VRS P                   P                   P*                  R7      RR7      V	VR7      # )a
  
        Certain schemas are 'related', in that they are simply
        inplace/out/functional versions of the same function.  This method
        factors these schemas into the "core" functional signature which
        is equal across all versions.

        Here is what normalization happens to the schema to convert
        it to a signature:
        - The overload name is stripped (name is retained, since
          it expresses semantic content about what the function does)
        - Inplace is set False
        - Out arguments are stripped
        - Mutable post_self_positional args are converted to returns
        - Mutability annotations are stripped  (this is sound
          because you cannot overload on mutability annotation)
        - Return names are stripped since they are not overloadable and
          some variants have return names but some not
        - TensorOptions are dropped
          because out= variants of factory functions don't include them
          (and we want to be able to pair up factory functions with their out variants)

        Finally, we want to be able to pair up related "view" and their
        corresponding "view_copy" operators. We do this by optionally
        stripping the trailing "_copy" from the base name.

        Example of a mutable op before and after:

        f.func (Mutable operator):
_fused_moving_avg_obs_fq_helper(Tensor self, Tensor observer_on, Tensor fake_quant_on, Tensor(a!) running_min, Tensor(b!) running_max, Tensor(c!) scale, Tensor(d!) zero_point, float averaging_const, int quant_min, int quant_max, int ch_axis, bool per_row_fake_quant=False, bool symmetric_quant=False) -> (Tensor output, Tensor mask)  # noqa: B950

        f.func (Corresponding functional operator):
_fused_moving_avg_obs_fq_helper.functional(Tensor self, Tensor observer_on, Tensor fake_quant_on, Tensor running_min, Tensor running_max, Tensor scale, Tensor zero_point, float averaging_const, int quant_min, int quant_max, int ch_axis, bool per_row_fake_quant=False, bool symmetric_quant=False) -> (Tensor output, Tensor mask, Tensor running_min_out, Tensor running_max_out, Tensor scale_out, Tensor zero_point_out)  # noqa: B950

        f.func.signature() output:
_fused_moving_avg_obs_fq_helper(Tensor self, Tensor observer_on, Tensor fake_quant_on, Tensor running_min, Tensor running_max, Tensor scale, Tensor zero_point, float averaging_const, int quant_min, int quant_max, int ch_axis, bool per_row_fake_quant=False, bool symmetric_quant=False) -> (Tensor, Tensor, Tensor, Tensor, Tensor, Tensor)  # noqa: B950
c                    V ^8  d   QhRRRR/# )r   r   Returnr   r   )r   s   "r   r   .FunctionSchema.signature.<locals>.__annotate__  s     	 	F 	v 	r   c                \   < \        S'       d   V P                  MR V P                  R R7      # )Nr;   r  r  )r  r;   r  )r   r  s   &r   strip_ret_annotation6FunctionSchema.signature.<locals>.strip_ret_annotation  s%    0QVVdVV r   _copyr  _scatterscatterinversec              3    <a"   T F  oSP                   f   K  SP                   P                  '       g   K1  \        ;QJ d)    V3R lSP                   4       F  '       g   K   RM	  RM! V3R lSP                   4       4      '       d   K  \	        S'       d   SP
                   R2MR SP                  R R7      x  K  	  R # 5i)Nc              3  V   <"   T F  pSP                   VP                   8H  x  K   	  R # 5ir9   r  r  s   & r   r   5FunctionSchema.signature.<locals>.<genexpr>.<genexpr>@  s     Kl4lr  TF_outr  )r  r  r  r  r  r;   r  )r   r  r  r"   s   &@r   r   +FunctionSchema.signature.<locals>.<genexpr>*  s      ,

 ||!" %%#$ CKdllKCCCKdllKK%F(9xt_tVV 

s!   CC
CC#%C7C)r  zbernoulli.pzfloat pzfloat p=0.5Fr  r  dunder_methodr  r  )r;   r  r  replacetupler|  r}  r  r  r  r  r  mapr  r  r   rl  rK   rR  r  BaseOperatorNamer  )
r"   r  r  r  r  	base_namereturns_from_mutable_inputsoriginal_returnsr  args_sigs
   f$$d      r   r  FunctionSchema.signature  s   X	 	 IINN''	!!'**%--gr:	##J//%--iC	 ',e ,
 __
 ~~..: ^^,,556""33
,
ee ,
 __
 ~~..: ^^,,556""33
,
 '
#0 !%94<<!HI"@>>++-+Htyy>]* s8}'<'<Y'VWH%"!"&))..">">
 ! 
 	
r   c                   V ^8  d   QhRR/# r+  r   )r   s   "r   r   ro  X  s     9 9 9r   c                	&    V P                  R R7      # )Tr  )r  r!   s   &r   view_signatureFunctionSchema.view_signatureX  s    ~~4~88r   c                    V ^8  d   QhRRRR/# )r   r;   r  r   rR  r   )r   s   "r   r   ro  [  s     
 
l 
~ 
r   c                	F    \        VV P                  V P                  R 7      # )r  )rR  r  r  )r"   r;   s   &&r   	with_nameFunctionSchema.with_name[  s     nnLL
 	
r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   ro  c  s     W WD Wr   c                	    V P                  4       \        P                  \        P                  \        P                  39   # r9   )r  r  r  r  r  r!   s   &r   modifies_arguments!FunctionSchema.modifies_argumentsb  s*    yy{z11:>>:CUCUVVVr   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   ro  f  s     / /D /r   c                	6    V P                   P                  4       # r9   )r  has_symint_argr!   s   &r   
has_symintFunctionSchema.has_symintf  s    ~~,,..r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ro  i  s     @ @ @r   c                	0   \        V P                  4      p\        V P                  4      ^8X  d   \        V P                  ^ ,          4      pM7RRP	                  \        \         V P                  4      4      ,           R,           pV P                   RV RV 2# )r  rE  r  r  z) -> )r   r  r  r  r   r  r;   )r"   all_arguments_strr  s   &  r   r#   FunctionSchema.__str__i  st    /t||!$,,q/*GDIIc#t||&<==CG))A/0gY??r   r   N)r%   r&   r'   r(   r)   r  rx  r  recompiler  r   rK   r  r  r  r  r  r  r  r  r  r  r  r#   r*   r   r   r   rR  rR    s       A A
 jjOPG 
tl7(:*)`&g
 $g
 &+	g

 #(g
R9
 W W/@ @r   rR  c                  X    ] tR tRt$ R]R&   R]R&   R]R&   ]R R l4       tR	 R
 ltRtR# )
Annotationiz  ztuple[str, ...]	alias_setr   r  r  c                    V ^8  d   QhRRRR/# )r   annr   r   r  r   )r   s   "r   r   Annotation.__annotate__  s     $ $3 $: $r   c                	   \         P                  ! R V 4      pVf   \        RV  24      hVP                  ^4      VP                  ^4      '       d   VP                  ^4      MR,           p\	        VP                  R4      4      pVP                  ^4      R8H  pV'       d    \        V4      ^8  d   \        RV  R24      hVP                  ^4      '       d*   \	        VP                  ^4      P                  R4      4      MR
p\        V4      ^8  d    \        V4      ^8  d   \        RV  R24      h\        W4VR7      p\        V4      V 8w  d   \        V R	V  24      hV# )z2^([a-z])(\|[a-z])*(!?)( -> (\*|[a-z](\|[a-z])*))?$zunrecognized alias annotation r  |!z,alias set larger than 1 is not mutable, got z	 instead.zSbefore alias set and after alias set cannot be larger than 1 at the same time, got )r  r  r  r  r   )	r  matchrG   groupr  r  r  r  r   )r  r`  before_aliasr  r  	after_setr   s   &      r   rK   Annotation.parse  s<     HHJCP9 #A#!GHHwwqz1771::QWWQZ2F,,,S12	771:$I* >se9M  56GGAJJE!''!***3/0B	|q S^a%7 efiejjst  I
 q6S= A3d3%11r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s       r   c                	    R P                  V P                  4      pV P                  '       d   V R2pR P                  V P                  4      pV'       d   V RV 2pV# )r  r	   -> )r   r  r  r  )r"   r  r  s   &  r   r#   Annotation.__str__  sV    HHT^^,	===$+QI((4#7#78$+T/):;Ir   r   N)	r%   r&   r'   r(   r)   r   rK   r#   r*   r   r   r   r  r  z  s2     N$$$ $L r   r  c                      ] tR tRt]R R l4       t]R R l4       tR R ltR R	 ltR
 R lt	R R lt
R R ltR R ltR R ltRtR# )Typei  c                    V ^8  d   QhRRRR/# r   r  r   r   r  r   )r   s   "r   r   Type.__annotate__  s        r   c                	p    \         P                  V 4      p\        V4      V 8w  d   \        V R V  24      hV# )r  )r  _parser   rG   )r  r   s   & r   rK   
Type.parse  s4    KKNq6Q; A3d1#//r   c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r    s     @ @# @$ @r   c                	`   \         P                  ! R V 4      pVe.   \        \        P	                  VP                  ^4      4      4      # \         P                  ! RV 4      pVe_   VP                  ^4      e   \        VP                  ^4      4      MRp\        \        P	                  VP                  ^4      4      VR7      # \         P                  ! RV 4      pVe   \        VP                  ^4      4      #  \        \        V ,          4      #   \         d   p\        RT  24      ThRp?ii ; i)z^(.+)\?$Nz^(.+)\[([0-9]+)?\]$)elemsizez-^__torch__\.torch\.classes\.([a-zA-Z0-9_.]+)$zunrecognized type )r  r
  OptionalTyper  rK   r  r   ListTypeCustomClassTyper  r  KeyErrorr"  )r  r`  r  r  s   &   r   r  Type._parse  s    HH[!$=

1771: 677HH+Q/=&'ggaj&<3qwwqz?$DAGGAJ!7dCC HHEqI="1771:..	@F1I&& 	@!3A378a?	@s   8D D-D((D-c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     " " "r   c                	    \         hr9   NotImplementedErrorr!   s   &r   r#   Type.__str__      !!r   c                    V ^8  d   QhRRRR/# r   base_tyr  r   r   r   )r   s   "r   r   r    s     " "v "$ "r   c                	    \         hr9   r&  r"   r,  s   &&r   is_base_ty_likeType.is_base_ty_like  r)  r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r         3 3 3r   c                	@    V P                  \        P                  4      # r9   )r/  r  r  r!   s   &r   is_tensor_likeType.is_tensor_like      ##FMM22r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r    s     6 64 6r   c                	@    V P                  \        P                  4      # r9   )r/  r  	Generatorr!   s   &r   is_generator_likeType.is_generator_like  s    ##F$4$455r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r    r2  r   c                	@    V P                  \        P                  4      # r9   )r/  r  SymIntr!   s   &r   is_symint_likeType.is_symint_like  r6  r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r    s     " "T "r   c                	    \         hr9   r&  r!   s   &r   is_nullableType.is_nullable  r)  r   c                   V ^8  d   QhRR/# r   r   zListType | Noner   )r   s   "r   r   r    s     " "o "r   c                	    \         hr9   r&  r!   s   &r   is_list_likeType.is_list_like  r)  r   r   N)r%   r&   r'   r(   r   rK   r  r#   r/  r4  r:  r?  rC  rH  r*   r   r   r   r  r    sR      @ @$""363"" "r   r  c                  .   ] tR tRt]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t	]! 4       t
]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       t]! 4       tRtR# )r  i  r   N)r%   r&   r'   r(   r   r9  r  r  r   Dimname	DimVectorfloatr   r   LayoutDeviceDeviceIndexScalarMemoryFormatQSchemeStorageStreamr>  SymBoolGraphModuler*   r   r   r   r  r    s    IJVF
&CfGIFE
&C6DVFVF&KVF6LfGfGVFVFfG&Kr   r  c                  ^    ] tR tRt$ R]R&   R R ltR R ltR R	 ltR
 R ltR R lt	Rt
R# )r  i  r  r;   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   BaseType.__annotate__  s     # # #r   c                	0    V P                   P                    # r9   r:   r!   s   &r   r#   BaseType.__str__  s    ))..!"r   c                    V ^8  d   QhRRRR/# r+  r   )r   s   "r   r   rZ    s     $ $v $$ $r   c                	     V P                   V8H  # r9   r:   r.  s   &&r   r/  BaseType.is_base_ty_like  s    yyG##r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rZ    s      T r   c                	    R # Fr   r!   s   &r   rC  BaseType.is_nullable      r   c                   V ^8  d   QhRR/# rF  r   )r   s   "r   r   rZ          o r   c                	    R # r9   r   r!   s   &r   rH  BaseType.is_list_like      r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rZ         * * *r   c                	<    V P                   \        P                  8H  # r9   )r;   r  r>  r!   s   &r   r?  BaseType.is_symint_like  s    yyFMM))r   r   N)r%   r&   r'   r(   r)   r#   r/  rC  rH  r?  r*   r   r   r   r  r    s%    
L#$* *r   r  c                  ^    ] tR tRt$ R]R&   R R ltR R ltR R	 ltR
 R ltR R lt	Rt
R# )r  i  r  r  c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   OptionalType.__annotate__!  s       r   c                	     V P                    R 2# )?)r  r!   s   &r   r#   OptionalType.__str__!  s    ))Ar   c                    V ^8  d   QhRRRR/# r+  r   )r   s   "r   r   rp  $       2 2v 2$ 2r   c                	8    V P                   P                  V4      # r9   r  r/  r.  s   &&r   r/  OptionalType.is_base_ty_like$      yy((11r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rp  '  rk  r   c                	6    V P                   P                  4       # r9   r  r?  r!   s   &r   r?  OptionalType.is_symint_like'      yy''))r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   rp  *  s      T r   c                	    R # )Tr   r!   s   &r   rC  OptionalType.is_nullable*  ri  r   c                   V ^8  d   QhRR/# rF  r   )r   s   "r   r   rp  -  s     ( (o (r   c                	6    V P                   P                  4       # r9   )r  rH  r!   s   &r   rH  OptionalType.is_list_like-  s    yy%%''r   r   Nr%   r&   r'   r(   r)   r#   r/  r?  rC  rH  r*   r   r   r   r  r    s%    
J2*( (r   r  c                  ^    ] tR tRt$ R]R&   R R ltR R ltR R	 ltR
 R ltR R lt	Rt
R# )r!  i2  r   
class_namec                   V ^8  d   QhRR/# r   r   )r   s   "r   r   CustomClassType.__annotate__6  s     < < <r   c                     RV P                    2# )z;
Return the class name will prefix __torch__.torch.classes
z__torch__.torch.classes.)r  r!   s   &r   r#   CustomClassType.__str__6  s     *$//):;;r   c                    V ^8  d   QhRRRR/# r+  r   )r   s   "r   r   r  <  s      v $ r   c                	    R # rb  r   r.  s   &&r   r/  CustomClassType.is_base_ty_like<  rd  r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  ?  s       r   c                	    R # rb  r   r!   s   &r   r?  CustomClassType.is_symint_like?  rd  r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  B  s      T r   c                    R# )z(
Assume a custom class is not nullable.
Fr   r!   s   &r   rC  CustomClassType.is_nullableB  s     r   c                   V ^8  d   QhRR/# rF  r   )r   s   "r   r   r  H  rf  r   c                	    R # r9   r   r!   s   &r   rH  CustomClassType.is_list_likeH  ri  r   r   Nr  r   r   r   r!  r!  2  s%    O< r   r!  c                  h    ] tR tRt$ R]R&   R]R&   R R ltR R	 ltR
 R ltR R ltR R lt	Rt
R# )r   iS  r  r  z
int | Noner  c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   ListType.__annotate__X  s     & & &r   c                	h    V P                   '       d   V P                    MR pV P                   RV R2# )r  [])r  r  )r"   r  s   & r   r#   ListType.__str__X  s.    !%$))))AdV1%%r   c                    V ^8  d   QhRRRR/# r+  r   )r   s   "r   r   r  \  ru  r   c                	8    V P                   P                  V4      # r9   rw  r.  s   &&r   r/  ListType.is_base_ty_like\  ry  r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  _  rk  r   c                	6    V P                   P                  4       # r9   r|  r!   s   &r   r?  ListType.is_symint_like_  r~  r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  b  s     ' 'T 'r   c                	6    V P                   P                  4       # r9   )r  rC  r!   s   &r   rC  ListType.is_nullableb  s    yy$$&&r   c                   V ^8  d   QhRR/# rF  r   )r   s   "r   r   r  e  rf  r   c                	    V # r9   r   r!   s   &r   rH  ListType.is_list_likee  s    r   r   Nr  r   r   r   r   r   S  s+    
J
&2*' r   r   c                      ] tR tRt$ R]R&   R]R&   R]R&   R]R	&   ]R
 R l4       t]R R l4       t]R R l4       t	R R lt
RtR# )rr  ii  r   r;   r  r  rW  ru  Annotation | Noner  c                   V ^8  d   QhRR/# r   r   r  r   )r   s   "r   r   Argument.__annotate__        - r   c                	    V P                   # r9   r  r!   s   &r   
alias_infoArgument.alias_info      r   c                    V ^8  d   QhRRRR/# )r   r  r   r   rr  r   )r   s   "r   r   r    s     & &3 &8 &r   c                	   R V 9  d   \        RV  R24      hRV 9   dU   V P                  R4      ^8w  d   \        RV  R24      hV P                  R4      w  rVP                  R ^4      w  r4V RV 2pMV P                  R ^4      w  r5TpRp\        P
                  ! RV4      pV'       dq   VP                  ^4      R9  d   \        RVP                  ^4       24      hRVP                  ^4      ,           p\        P                  VP                  ^4      4      pMTpRp\        P                  V4      p	\        VV	VVR	7      p
\        V
4      V 8w  d   \        \        V
4       R
V  24      hV
# )rD  zillegal argument 'r  =z&illegal argument with default value: 'NTensor\((.+)\)(.*).unrecognized alias analysis form with Tensor: r  r;   r  ru  r  r  r  rr  z[])rG   countr  rsplitr  r
  r  r  rK   r  rr  r   )r  type_and_annot_and_nameru  type_and_annotr;   name_and_defaultr
  type_sr  r  r   s   &          r   rK   Argument.parse  sl    c> #5cU!!<==#:yy~"$'McURS%TUU/2yy~,##:#A#A#q#I N"&q	2/2zz#q/A,N#DG.?{{1~_4$DU[[QR^DTU  A.F#))%++a.9J#FJzz&!!	
 q6S= CF84u!566r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r         H H$ Hr   c                	Z    V P                   R J;'       d    V P                   P                  # r9   r  r!   s   &r   r  Argument.is_write  #    d*GGt/G/GGr   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     5 5 5r   c                	6   V P                    pV P                  '       d6   VR9  d   \        RV 24      hVP                  R RV P                   R24      pV P                  f   V# RpV P
                  '       d   RV P
                   2pV RV P                   V 2# )r  annotation on non-Tensor type: Tensor(r  r  r  rD  r  zTensor?zTensor[])r  r  rG   r  r;   ru  )r"   r  
mb_defaults   &  r   r#   Argument.__str__  s    ))???<<$'Ftf%MNN<<GDOO3DA*FGD99KJ||| /
V1TYYK
|44r   r   Nr%   r&   r'   r(   r)   r  r  r   rK   r  r#   r*   r   r   r   rr  rr  i  sc    
 I
J* "!  & &P H H5 5r   rr  c                      ] tR tRt$ R]R&   R]R&   R]R&   ]R R	 l4       t]R
 R l4       t]R R l4       t	R R lt
RtR# )r  i  rW  r;   r  r  r  r  c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   Return.__annotate__  r  r   c                	    V P                   # r9   r  r!   s   &r   r  Return.alias_info  r  r   c                    V ^8  d   QhRRRR/# )r   r  r   r   r  r   )r   s   "r   r   r    s      3 6 r   c                	   R V 9   d   V P                  R ^4      w  rMT pRp\        P                  ! RV4      pV'       dq   VP                  ^4      R9  d   \	        RVP                  ^4       24      hRVP                  ^4      ,           p\
        P                  VP                  ^4      4      pMTpRp\        P                  V4      p\        VVVR7      p\        V4      V 8w  d   \	        \        V4       RV  24      hV# )rD  Nr  r  r  r  r  r  )
r  r  r
  r  rG   r  rK   r  r  r   )r  r  r;   r
  r  r  r  r   s   &       r   rK   Return.parse  s     #:#&::c1#5 ND ND.?{{1~_4$DU[[QR^DTU  A.F#))%++a.9J#FJzz&!!

 q6S= CF84u!566r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r    r  r   c                	Z    V P                   R J;'       d    V P                   P                  # r9   r  r!   s   &r   r  Return.is_write  r  r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r    s     	) 	) 	)r   c                	    V P                    pV P                  '       d6   VR9  d   \        RV 24      hVP                  R RV P                   R24      pV P                  f   V# V RV P                   2# )r  r  r  r  rD  r  )r  r  rG   r  r;   )r"   r  s   & r   r#   Return.__str__  st    ))???<<$'Ftf%MNN<<GDOO3DA*FGD99KV1TYYK((r   r   Nr  r   r   r   r  r    sY    

J!!   < H H	) 	)r   r  c                  "    ] tR tRt$ R]R&   RtR# )SelfArgumenti	  rr  r  r   N)r%   r&   r'   r(   r)   r*   r   r   r   r  r  	  s    r   r  c                  L    ] tR tRt$ R]R&   R]R&   R]R&   R]R&   R R ltR	tR
# )TensorOptionsArgumentsi		  rr  dtypelayoutdevice
pin_memoryc                   V ^8  d   QhRR/# r   r   zSequence[Argument]r   )r   s   "r   r   #TensorOptionsArguments.__annotate__	  s     G G' Gr   c                	^    V P                   V P                  V P                  V P                  .# r9   r  r  r  r  r!   s   &r   allTensorOptionsArguments.all	  s!    

DKKdooFFr   r   N)r%   r&   r'   r(   r)   r  r*   r   r   r   r  r  		  s%    OG Gr   r  c                     ] tR tRt$ R]R&   R]R&   R]R&   R]R&   R]R	&   R]R
&   R]R&   ]R R l4       t]R R l4       t]R R l4       t]R R l4       t	]R R l4       t
]R R l4       t]R R l4       t]R R l4       t]R R l4       tR R ltR  R! ltR" R# ltR$ R% ltR&R'/R( R) lltR* R+ ltR, R- lt]R. R/ l4       t]R0 R1 l4       tR2 R3 ltR4 R5 ltR6tR7# )8rl  i	  ztuple[Argument, ...]pre_self_positionalzSelfArgument | Noner  r  pre_tensor_options_kwarg_onlyzTensorOptionsArguments | Noner  post_tensor_options_kwarg_onlyr  c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   Arguments.__annotate__,	  s      0 r   c                	v    . pVP                  V P                  4       VP                  V P                  4       V# r9   )r   r~  r  r"   r  s   & r   flat_non_outArguments.flat_non_out+	  s0     

4''(

4''(
r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  3	        !3 r   c                	    . pVP                  V P                  4       V P                  e&   VP                  V P                  P                  4       VP                  V P
                  4       V# r9   )r   r  r  r  r  r  r  s   & r   r~  Arguments.flat_positional2	  sP     

4++,==$JJt}}--.

4,,-
r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  <	  s     D D.@ Dr   c                	j    V P                    Uu. uF  qP                  '       g   K  VNK  	  up# u upi r9   )r  r  r"   r  s   & r   r  &Arguments.post_self_positional_mutable;	  s(    44C4a

4CCCs   00c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  A	  r  r   c                	    . pVP                  V P                  4       V P                  e*   VP                  V P                  P                  4       4       VP                  V P                  4       V# r9   )r   r  r  r  r  r  s   & r   r  Arguments.flat_kwarg_only@	  sW     

4556*JJt**..01

4667
r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  J	  s      , r   c                	    . pVP                  V P                  4       VP                  V P                  4       VP                  V P                  4       V# r9   )r   r~  r  r  r  s   & r   r  Arguments.flat_allI	  s@     

4''(

4''(

488
r   c                   V ^8  d   QhRR/# r   r   z:Sequence[Argument | SelfArgument | TensorOptionsArguments]r   )r   s   "r   r   r  R	  s      	Cr   c                	v    . pVP                  V P                  4       VP                  V P                  4       V# r9   )r   
positional
kwarg_onlyr  s   & r   non_outArguments.non_outQ	  s0     GI

4??#

4??#
r   c                   V ^8  d   QhRR/# )r   r   z!Sequence[Argument | SelfArgument]r   )r   s   "r   r   r  [	  s      = r   c                	    . pVP                  V P                  4       V P                  e   VP                  V P                  4       VP                  V P                  4       V# r9   )r   r  r  r  r  r  s   & r   r  Arguments.positionalZ	  sJ    -/

4++,==$JJt}}%

4,,-
r   c                   V ^8  d   QhRR/# )r   r   z+Sequence[Argument | TensorOptionsArguments]r   )r   s   "r   r   r  d	  s      G r   c                	    . pVP                  V P                  4       V P                  e   VP                  V P                  4       VP                  V P                  4       V# r9   )r   r  r  r  r  r  s   & r   r	  Arguments.kwarg_onlyc	  sN    79

4556*JJt**+

4667
r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  m	  s      O r   c                	    . pVP                  V P                  4       VP                  V P                  4       VP                  V P                  4       V# r9   )r   r  r	  r  r  s   & r   r  Arguments.alll	  s<    FH

4??#

4??#

488
r   c                   V ^8  d   QhRR/# r   r   z	list[str]r   )r   s   "r   r   r  t	  s     
 
9 
r   c                	    V P                    Uu. uF=  pVP                  f   K  VP                  P                  '       g   K1  VP                  NK?  	  up# u upi r9   )r  r  r  r;   r  s   & r   mutable_arg_namesArguments.mutable_arg_namest	  sL     ]]
"|| ,-LL,A,A AFF"
 	
 
s   AAAc                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  {	       G G Gr   c                	    \         ;QJ d&    R  V P                   4       F  '       g   K   R# 	  R# ! R  V P                   4       4      # )c              3  T   "   T F  qP                   P                  4       x  K   	  R # 5ir9   )r  r4  r  s   & r   r   +Arguments.has_tensor_arg.<locals>.<genexpr>|	        F4Eq66((**4E   &(TFr  r  r!   s   &r   r  Arguments.has_tensor_arg{	  7    sFD4E4EFssFsFsFD4E4EFFFr   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  ~	  r  r   c                	    \         ;QJ d&    R  V P                   4       F  '       g   K   R# 	  R# ! R  V P                   4       4      # )c              3  T   "   T F  qP                   P                  4       x  K   	  R # 5ir9   )r  r?  r  s   & r   r   +Arguments.has_symint_arg.<locals>.<genexpr>	  r  r   TFr!  r!   s   &r   r  Arguments.has_symint_arg~	  r#  r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  	  s     J J4 Jr   c                	    \         ;QJ d&    R  V P                   4       F  '       g   K   R# 	  R# ! R  V P                   4       4      # )c              3  T   "   T F  qP                   P                  4       x  K   	  R # 5ir9   )r  r:  r  s   & r   r   .Arguments.has_generator_arg.<locals>.<genexpr>	  s      I7H!66++--7Hr   TFr!  r!   s   &r   r  Arguments.has_generator_arg	  s7    sIt7H7HIssIsIsIt7H7HIIIr   r  Fc                    V ^8  d   QhRRRR/# )r   r  r   r   rl  r   )r   s   "r   r   r  	  s     #
 #
$ #
9 #
r   c               	  a R  V3R llp\        \        \        W P                  4      4      V P                  e&   \        V! V P                  P                  4      4      MR\        \        W P                  4      4      \        \        W P                  4      4      \        \        W P                  4      4      ,           RRRR7      # )c                    V ^8  d   QhRRRR/# )r   r  rr  r   r   )r   s   "r   r   )Arguments.signature.<locals>.__annotate__	  s     	 	H 	 	r   c                ~   < \        V P                  V P                  S'       g   V P                  R R7      # R R R7      # )Nr  )rr  r;   r  ru  )r  r  s   &r   strip_arg_annotation1Arguments.signature.<locals>.strip_arg_annotation	  s=    VVVV)6			  =A	 r   Nr  r  r  r  r  r  r  r   )
rl  r  r  r  r  r  r  r  r  r  )r"   r  r3  s   &d r   r  Arguments.signature	  s    	 	  %(*B*BC!
 ==, 1$--2H2HIJ!&(*C*CD"
 +0(*L*LM+ C,.Q.QRS+T  +-/
 	
r   c                   V ^8  d   QhRR/# )r   r   rl  r   )r   s   "r   r   r  	  s     
 
	 
r   c           
     	    V P                   f   \        R4      h\        P                  ! V \	        \        P                  ! V P                   P
                  R R7      4      R7      # )Nz2remove_self_annotation called but self_arg is Noner  )r  )r  rG   dataclassesr  r  r  r!   s   &r   remove_self_annotation Arguments.remove_self_annotation	  sP    ==  !UVV""!##DMM$:$:tL
 	
r   c                    V ^8  d   QhRRRR/# )r   r  list[Argument]r   rl  r   )r   s   "r   r   r  	  s     
 
. 
Y 
r   c                	    \        V P                  4      ^ 8w  d   \        RV P                   24      h\        P                  ! V \        V4      R7      # )r   z0with_out_args called but self.out is not empty: )r  )r  r  rG   r9  r  r  )r"   r  s   &&r   with_out_argsArguments.with_out_args	  sL    txx=A B488*M  ""d
 	
r   c                    V ^8  d   QhRRRR/# )r   r  r   r   z5tuple[list[Argument], list[Argument], list[Argument]]r   )r   s   "r   r   r  	  s     %+ %+ %+ U %+r   c                	   . p. p. pTpV P                  R 4       F  pV'       g   K  VR8X  d   WAJd   \        R4      hTpK(  \        P                  V4      pVP                  e+   VP                  P
                  '       d   WAJ d   M&WBJ d   TpMWCJ d   \        RVP                   R24      hVP                  V4       K  	  WV3# )r  r  z:invalid syntax: kwarg-only specifier * can only occur onceznon-mutable argument 'z%' cannot follow mutable out arguments)r  rG   rr  rK   r  r  r;   r  )r  r  r	  r  arguments_accr  pargs   &      r   	_preparseArguments._preparse	  s    %'
%'
 " ::d#Ccz 2(T  !+>>#&D *t/G/G/G ."0$'M '(0;`a    &7 $: s**r   c                    V ^8  d   QhRRRR/# )r   r  r   r   rl  r   )r   s   "r   r   r  	  s     P
 P
C P
I P
r   c                   \         P                  V 4      w  rpRp\        V4       F  w  rVVP                  R8X  g   K  Tp M	  Ve#   VRV p\	        W,          4      pW^,           R p	M. pRpTp	. p
Rp. pT
pR R lpV! R\
        P                  R4      4      V! R\
        P                  R4      4      V! R	\
        P                  R
4      4      V! R\
        P                  R4      4      .p^ pV\        V4      8  Ed   V\        V4      \        V4      ,
          8:  d   \        ;QJ d7    R \        WWU\        V4      ,            4       4       F  '       d   K   RM,	  RM(! R \        WWU\        V4      ,            4       4       4      '       dd   WJd   \        R4      h\        W%,          W%^,           ,          W%^,           ,          W%^,           ,          R7      pV\        V4      ,          pTpEK  VP                  W%,          4       V^,          pEK'  \        \        V4      V\        V	4      \        V
4      V\        V4      \        V4      R7      # )z
Input: 'int x, int y, int z'
Nr"   c               $    V ^8  d   QhRRRRRR/# )r   r;   r   tyr  r   zCallable[[Argument], bool]r   )r   s   "r   r   %Arguments.parse.<locals>.__annotate__

  s'     	Q 	Qs 	Q 	Q)C 	Qr   c                   a a V V3R  l# )c                f   < V P                   S8H  ;'       d    V P                  S\        S4      39   # r9   )r;   r  r  )r  r;   rJ  s   &r   <lambda>/Arguments.parse.<locals>.pred.<locals>.<lambda>
  s+    QVVt^PP2|B?O:P0PPr   r   )r;   rJ  s   ffr   predArguments.parse.<locals>.pred

  s	    PPr   r  r  r  rN  r  rO  r  r   c              3  6   "   T F  w  rV! V4      x  K  	  R # 5ir9   r   )r   pr  s   &  r   r   "Arguments.parse.<locals>.<genexpr>
  s       T aDD Ts   FTz-tensor options arguments can only appear oncer  r5  )rl  rE  	enumerater;   r  r  rK   r  r  r  rG   r  r  r  )r  r  r	  r  self_ixir  r  r  r  r  r  r  kwarg_only_accrP  
predicatess   &               r   rK   Arguments.parse	  s-    '0&9&9$&?#
 j)DAvv * ",Xg"6#J$78H#-km#< "$H#-  9;%8<9;&6	Q $**\234::h/04::h/0tzz&12	

 #j/!C
Oc*o553  #J13z??R0S T333  #J13z??R0S T   &J,K  &<(m)a%0)a%0#-!e#4	&N Z(A%CN!!*-0FA %&9 :!&';!<*/0M*N)+01O+Pc

 	
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r  8
  s     ( ( (r   c                	   . pVP                  \        \        V P                  4      4       V P                  '       g   V P
                  '       d   VP                  R 4       VP                  \        \        V P                  4      4       VP                  \        \        V P
                  4      4       RP                  V4      # )r  r  )r   r  r   r~  r  r  r  r   )r"   all_argumentss   & r   r#   Arguments.__str__8
  s    #%Sd&:&:;<4888  %Sd&:&:;<Sdhh/0yy''r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r  A
  s      t r   c                	   V P                   f   V P                  '       d   \        R4      hV P                  f   V P                  '       d   \        R4      hV P                   Uu. uF3  pVP
                  f   K  VP
                  P                  '       g   K1  VNK5  	  pp\        V4      ^ 8w  d   \        RV 24      hR # u upi )Nz5pre_self_positional is non-empty but self_arg is NonezFpost_tensor_options_kwarg_only is non-empty but tensor_options is NonezQmutable pre_self_positional arguments are not currently supported in the schema: )r  r  rG   r  r  r  r  r  )r"   r  mutable_pre_self_positionalss   &  r   r  Arguments.__post_init__A
  s     == '''$K  &222$\  --(
-|| ,-LL,A,A A- 	% (

 +,1 c  eA  dB  C  2(
s   %C :C C r   N)r%   r&   r'   r(   r)   r  r  r~  r  r  r  r
  r  r	  r  r  r  r  r  r  r:  r?  r   rE  rK   r#   r  r*   r   r   r   rl  rl  	  sO   
 .-!!..#7711 %98 
    D D            
GGJ#
 #
J

 %+ %+N P
 P
d( r   rl  c                  t    ] tR tRt$ R]R&   R]R&   R]R&   RtR]R&   R	tR
]R&   ]R R l4       tR R lt	Rt
R	# )r  it
  r   r  r   r  r  Fr   NrW  rQ  c                    V ^8  d   QhRRRR/# )r   r  r   r   r  r   )r   s   "r   r   BaseOperatorName.__annotate__
  s     ? ?# ?* ?r   c                	  a
 V R 8X  d   \        R4      hV P                  R4      '       d   \        R4      h\        P                  ! RV 4      pV'       d   VP	                  ^4      MR pV'       d   VP	                  ^4      MT p\        P                  ! RV4      pVe   RpVP	                  ^4      o
\
        ;QJ d#    V
3R l\         4       F  '       g   K   RM	  R	M! V
3R l\         4       4      '       d   RpS
R
,          o
M;R	pS
^ ,          R8X  d   \        RV  24      hMR	pVo
S
R,          R8X  d	   RpS
RR o
MR	pRpS
P                  V4      '       d1   RpS
R\        V4      )  o
V'       g	   V'       d   \        RV  24      hMR	p\        S
VVVVR7      p	\        V	4      V 8w  d   \        \        V	4       RV  24      hV	# )r  zoperator name cannot be emptyr  zs_out suffix is reserved and not permitted for operator names; did you mean to specify an out overload name instead?z^(?:(.*)::)?(.*)$z^__([^_]+)__$NTc              3  4   <"   T F  pSR V 28H  x  K  	  R# 5i)rW  Nr   )r   nr  s   & r   r   )BaseOperatorName.parse.<locals>.<genexpr>
  s     G,Fq4Qqc7?,Fr   F:r  NNrW  z,unexpected dunder method starting with 'i': __functionalz:functional overload cannot be a dunder method or inplace: )r  r  r  r   rQ  r  rF  )
rG   r  r  r
  r  r  AUGMENTED_ASSIGNMENT_NAMESr  r  r   )r  r
  rQ  op_without_nsr`  r  r  functional_suffixr   r   r  s   &         @r   rK   BaseOperatorName.parse
  s   8 !@AA;;v H  -r2&+EKKN	*/ARHH%}5= M771:DsG,FGsssG,FGGGBx
 7c>(FrdK  "
 "M DBx3CRy *==*++"&130112D $PQSPTU  !(
 #(' 3
 q6R< CF84t!455r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   re  
  s     7 7 7r   c                	8   V P                   '       d   V P                    R 2MRpV P                  '       d+   V P                  '       d   RMRpV RV V P                   R2# V P                  '       d   RMV P                  '       d   RMRpV V P                   V 2# )rv  r  rW  __rj  rk  )rQ  r  r  r  r   )r"   namespace_prefixrW  s   &  r   r#   BaseOperatorName.__str__
  s    48NNNdnn-R0|||A&'r!TYYKr:: <<<  +++ #  ''		{1#66r   r   )r%   r&   r'   r(   r)   r   rQ  r   rK   r#   r*   r   r   r   r  r  t
  sH    
IM( !&% !Iz ? ?B7 7r   r  c                  r    ] tR tRt$ R]R&   R]R&   ]R R l4       tR R	 ltR
 R ltR R lt	R R lt
RtR# )r  i
  r  r;   r   r  c                    V ^8  d   QhRRRR/# )r   rS  r   r   r  r   )r   s   "r   r   OperatorName.__annotate__
  s     	 	s 	| 	r   c                	    R V 9   d   V P                  R ^4      w  rMT pRp\        \        P                  V4      VR7      p\	        V4      V 8w  d   \        \	        V4       RV  24      hV# ).r  r  r  )r  r  r  rK   r   rG   )rS  r;   r  r   s   &   r   rK   OperatorName.parse
  sk    '>")--Q"7D-DM.44T:-Xq6W CF84y!9::r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rw  
  s     " " "r   c                	v    V P                   '       d   V P                   R V P                    2# V P                   # )ry  r  r;   r!   s   &r   r#   OperatorName.__str__
  6    ii[$"4"4!566ii[!r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   rw    s     " "# "r   c                	v    V P                   '       d   V P                   R V P                    2# V P                   # )rj  r}  r!   s   &r   unambiguous_nameOperatorName.unambiguous_name  r  r   c                   V ^8  d   QhRR/# )r   r   r  r   )r   s   "r   r   rw  
  s     
 
 
r   c                	    \        \        V P                  P                  R V P                  P                  R7      V P
                  R7      # Fr  r  )r  r  r;   r  r  r  r!   s   &r   remove_inplaceOperatorName.remove_inplace
  s=    !YY^^"ii55
 ,,
 	
r   c                    V ^8  d   QhRRRR/# )r   overloadr   r   r  r   )r   s   "r   r   rw    s     
 
c 
l 
r   c                	    \        \        V P                  P                  R V P                  P                  R7      VR7      # r  )r  r  r;   r  r  )r"   r  s   &&r   with_overloadOperatorName.with_overload  s7    !YY^^"ii55
 #
 	
r   r   N)r%   r&   r'   r(   r)   r   rK   r#   r  r  r  r*   r   r   r   r  r  
  s9    
	 	""

 
r   r  c               (    V ^8  d   QhRRRRRRRR/# )	r   r$  rP  rX  r	  brJ  r   r   r   )r   s   "r   r   r     s,      .3?	r   c                    V P                   P                  4       \        P                  J;'       d:    VP	                  V 4      '       * ;'       d    VP	                  VP                  4      # r9   )rS  r  r  r  ra  )r$  rX  r  s   &&&r   "gets_generated_out_inplace_wrapperr    sS     	
Z222 	' 	'Q	' 	'LL&r   c                      ] tR tRt$ R]R&   R]R&   R]R&   R R ltR	R
/R R llt]R R l4       t]R R l4       t	Rt
R# )NativeFunctionsViewGroupi4  rP  viewr
  	view_copyview_inplacec                   V ^8  d   QhRR/# r  r   )r   s   "r   r   %NativeFunctionsViewGroup.__annotate__>  s     3 3t 3r   c                	   V P                   P                  '       g-   \        R V P                   P                  P                   24      hV P
                  fj   \        V P                   4      '       dM   \        \        V P                   P                  P                  4       R\        V P                   4      : R24      hEMV P
                  P                  P                  P                  P                  P                  R4      '       g-   \        RV P
                  P                  P                   24      hV P                   P                  P                  4       V P
                  P                  P                  RR7      8w  d\   V P                   P                  P                  4       pV P
                  P                  P                  RR7      p\        RV RV 24      hR	V P
                  P                  9  dU   \        \        V P
                  P                  P                  4      \        V P                   P                  4      3 R
24      hV P                  e   V P                   P                  P                  4       V P                  P                  P                  4       8w  dZ   V P                   P                  P                  4       pV P                  P                  P                  4       p\        RV RV 24      hV P                   P                  '       d   V P                  e|   V P                  P                  '       g`   \        \        V P                   P                  P                  4       R\        V P                  P                  P                  4       R24      hV P                   P                  '       d   V P                  e~   V P                  P                  '       g`   \        \        V P                   P                  P                  4       R\        V P                  P                  P                  4       R24      hR# R# R# )zview is not a view op: Nz appears to be a new operator that aliases its inputs. The codegen expects you to add a corresponding operator to native_functions.yaml: z3. See Note [view_copy NativeFunctions] for details.z4view_copy name must end with '_copy' or '_scatter': Tr  z+view and view_copy signatures don't match: r  r  z appears to be a view_copy operator. The codegen expects view_copy operators to be annotated with the 'view_copy' tag in native_functions.yaml. See Note [view_copy NativeFunction] for details.z.view and view_inplace signatures don't match: r  z] must either both have CompositeImplicitAutograd kernels, or both not have composite kernels.zi must either both have CompositeImplicitAutogradNestedTensor kernels, or both not have composite kernels.)r  r  )r  r  rG   rS  r;   r  gets_generated_view_copyr   get_view_copy_namer  r  r  rk  r  rg  rh  )r"   view_sigview_copy_sigview_inplace_sigs   &   r   r  &NativeFunctionsViewGroup.__post_init__>  sy   yy### #:499>>;N;N:O!PQQ>>!'		22$499>>../0 1*49958 9II  3 >>&&++0055>>?TUU$J4>>K^K^KcKcJde  yy~~'')T^^-@-@-J-J%) .K .   99>>335 $ 3 3 = =SW = X$A(4P]_  $.."5"55$4>>..334c$))..6IIJ KH H 
 (yy~~'')T->->-C-C-M-M-OO99>>335#'#4#4#9#9#C#C#E $DXJdScRde  99;;;  ,((OOO(tyy~~2234E#d>O>O>T>T>Y>Y:Z9[ \l l  99III  ,((]]](tyy~~2234E#d>O>O>T>T>Y>Y:Z9[ \x x  ^ - Jr   include_copyTc                    V ^8  d   QhRRRR/# )r   r  r   r   r/  r   )r   s   "r   r   r  s  s     ! ! !9Q !r   c             #  	   "   V P                   x  V P                  e   V P                  x  V P                  e   V'       d   V P                  x  R # R # R # 5ir9   )r  r  r  )r"   r  s   &$r   r  "NativeFunctionsViewGroup.functionss  sD     ii(###>>%,..  +7%s   A AAc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r  {  s     # #3 #r   c                	.    V P                   P                  # r9   )r  r  r!   s   &r   r  "NativeFunctionsViewGroup.root_namez  s    yy"""r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r    s     @ @4 @r   c                	.    V P                   P                  # r9   )r  rg  r!   s   &r   	composite"NativeFunctionsViewGroup.composite~  s     yy???r   r   N)r%   r&   r'   r(   r)   r  r  r  r  r  r*   r   r   r   r  r  4  sR    
 %$''3j! ! # # @ @r   r  c                    V ^8  d   QhRRRR/# )r   r$  rP  r   r   r   )r   s   "r   r   r     s       4 r   c                    V P                   '       g   R # V P                  '       d   R # RV P                  9   d   R # V P                  P                  P                  P
                  P                  R4      '       d   R # R# )Fr  _inverseT)r  rg  rk  rS  r;   r  r  )r$  s   &r   r  r    s[    <<< 	/// 	vv{{%%j11r   c                    V ^8  d   QhRRRR/# )r   r$  rP  r   r  r   )r   s   "r   r   r     s      . \ r   c                   R .p\        V P                  P                  4      V9  d4   \        V 4      '       g#   \	        V P                  P                   R24      hV P                  P                  P                  P
                   R2p\        \        VRV P                  P                  P                  P                  R7      V P                  P                  P                  R7      pV# )narrowz, does not have a generated view_copy variantr  Fr  r  )
r   rS  r;   r  rG   r  r  r  r  r  )r$  -list_of_ops_with_explicit_view_copy_operatorsr  view_copy_names   &   r   r  r    s     6>J1
166;;LL'** 66;;-KL  66;;##(()/I!E9I9I9W9W
 ffkk//	N r   c                    V ^8  d   QhRRRR/# )r   r  r   r   rm  r   )r   s   "r   r   r     s     	G 	Gs 	G'9 	Gr   c                    V R8X  d   R# V ^ ,          R8X  d   V R,          R8X  d   V ^R p \         ;QJ d#    . R V P                  R4       4       F  NK  	  5# ! R V P                  R4       4       4      # )z
Input: '()'
Output: []
z()rE  r  c              3  L   "   T F  p\         P                  V4      x  K  	  R # 5ir9   )r  rK   r  s   & r   r    parse_returns.<locals>.<genexpr>  s     F.Esc"".Es   "$r  r   rF  )r  r  )r  s   &r   r  r    sl    
 d	1~RC!7!!B'5Fk.?.?.EF5F5Fk.?.?.EFFFr   c                  Z    ] tR tRt$ R]R&   R]R&   ]R R l4       tR R	 ltR
 R ltRt	R# )r  i  zdict[str, list[Argument]]r  r=  r  c                    V ^8  d   QhRRRR/# )r   srcobjectr   r  r   )r   s   "r   r   Precompute.__annotate__  s     ( (6 (j (r   c                	,   \        V \        4      '       g   \        R \        V 4       24      h. pRV R,          9  dP   V R,          P	                  R4      pV Uu. uF&  p\
        P                  VP                  4       4      NK(  	  ppV RR p / pV  F  p\        V\        4      '       g   \        R\        V4       24      hRV9  d   \        RV 24      hVP	                  R4      w  rgRV9   d   \        RV R24      hVP	                  R4      pV Uu. uF&  p\
        P                  VP                  4       4      NK(  	  p	pWV&   K  	  \        WAR	7      p
V
P                  4       V 8w  d    \        R
V
P                  4        RV  24      hV
# u upi u upi )z precomputed must be a list, got r  r{  Nz$precomputed item must be a str, got zSprecomputed parameters without replacement are allowed only in the last line, got: rD  zillegal kernel param name 'z' in precomputed parameters)r  r  zr.to_list() != src: r  rF  )r  r  rG   r  r  rr  rK   r  r   r  to_list)r  add_argsadd_listr;   r  raw_replace_itemr  with_list_raw	with_listwith_list_argsr   s   &          r   rK   Precompute.parse  s   #t$$ #CDI;!OPP R 2w}}S)HAIJtzz|4HJcr(C #.44$:4@P;Q:RS  --$ijzi{|  "2!7!7!?Ccz$1#6QR  &++C0IGPQythnnTZZ\:yNQ)CL# !$& w599;# #7		}D!NOO5 K( Rs   ,F,Fc                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r    s      t r   c                	   V P                    FD  pVP                  P                  4       VP                  8X  g   K.  \        R VP                   24      h	  V P                  P                  4        FM  pV FD  pVP                  P                  4       VP                  8X  g   K.  \        R VP                   24      h	  KO  	  R# )z5precomputed argument name must not be all uppercase: N)r  r;   upperrG   r  r  )r"   r  r  s   &  r   r  Precompute.__post_init__  s     Avv||~'$KAFF8T  
 LL'')D66<<>QVV+(OPQPVPVxX   *r   c                   V ^8  d   QhRR/# r  r   )r   s   "r   r   r    s       r   c                	    . pV P                   P                  4        F3  w  r#R P                  R V 4       4      pVP                  V RV 24       K5  	  V# )r  c              3  8   "   T F  p\        V4      x  K  	  R # 5ir9   r  )r   params   & r   r   %Precompute.to_list.<locals>.<genexpr>  s     $P=OESZZ=Or  r  )r  rF   r   r  )r"   replace_listkernel_paramreplacement_paramsreplacementss   &    r   r  Precompute.to_list  sX    040B0B0D,L99$P=O$PPL<.\N CD 1E r   r   N)
r%   r&   r'   r(   r)   r   rK   r  r  r*   r   r   r   r  r    s2     '&	( (T r   r  )r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   )r  	QuantizedrY   rZ   r[   r/   )r  submuldivmodpowlshiftrshiftandxoror)w__conditional_annotations__
__future__r   r9  r|  r  r   enumr   r   typingr   typing_extensionsr   torchgen.utilsr	   r
   collections.abcr   r   r   r   r,   r  r   r   AUTOGRAD_KEYSFRAGMENT_NAMESPACESr4   r   r   r   r   hasattrr   printr"  r   r~   r}   r   r   r   r   r   r   rX   r   r   r   r   r   r   r   r   rx   ry   rz   r{   r   r   r   r   r   r   r   r   r   rb   r  r   r   r   r   r  dispatch_device_mapr  r  r)   r  r  r!  r"  r   r$  r%  r'  r(  r7  rG  rK  rP  r  r	  r  r  rJ  rR  r  r  r  r  r  r!  r   rr  r  r  r  rl  rl  r  r  r  r  r  r  r  r  )	componentr  s   0@r   <module>r     s   " "   	 !    * 6 <<: $* * *d  (  "  ((,>,,>yJ,>,  #$:; 
_>$ _>DD  B {BG,,+-A!H2$rd"pqrpst 	 !  OOOOOO  #''9  OOOOOO))55))66     A!L*%
 ,V5H%P - -` 460 5&j  '
(8(8*:K:K'LMj %j667i  %Z0=3LLe !.u!5i8P!Po *i 88 " #;t ;4d 
T $ $U
G U
G U
Gp  $R
 R
 R
j $( ( (, $
 
 
B $9 9 9b $M@ M@ M@p $5 5 5| $3" 3" 3"nT . $*t * *( $(4 ( (( $d  @ $t  * $Z5 Z5 Z5z $5) 5) 5)r $   $G G G $D D DT
 * $n7 n7 n7f $3
 3
 3
l* $M@ M@ M@`.6	G $G G GY[,s   <W
