
    [Th3h                     |   % S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKJrJ	r	J
r
JrJrJr  S SKrS SKJr  S SKJr  S SKJr  SSKJrJr  S SKrS SKJr   / SQrSS	S
.r1 SkrS r S,S\S\R<                  \   S\R>                  4S jjr 0 r!\"\S4   \#S'    " S S5      r$\ RJ                   " S S5      5       r&S\S\	4S jr'S\SS4S jr(S\SS4S jr)S\S\*\\4   4S jr+S\SS4S jr,S \RZ                  S\.4S! jr/S\S"\R>                  SS4S# jr0S$\Rb                  S%\SS4S& jr2S' r3S( r4S-S) jr5S* r6S.S+ jr7g)/    N)FunctionSchemaOperatorName
SchemaKindBaseTypeListTypeBaseTy)get_ctx   )autograd_kernel_indirectionconstruct_autograd_kernel)infer_schema)	custom_opCustomOpr	   CPUCUDA)cpucuda>   atatenprimprimstorchpytorchc                  :    [         R                  " S[        5        g )Nzwtorch._custom_op is deprecated and will be removed in PyTorch 2.6, please use the equivalent torch.library API instead.)warningswarnDeprecationWarning     M/var/www/auris/envauris/lib/python3.13/site-packages/torch/_custom_op/impl.pywarn_deprecatedr!   -   s    MM	89KMr   qualnamemanual_schemareturnc                 ,   ^ ^ [        5         UU 4S jnU$ )D
This API is deprecated, please use torch.library.custom_op instead
c           	        > [         R                  " U 5      (       d  [        S[        U 5       35      e[	        T
5      u  p[        U5        U R                  U:w  a  [        ST
 SU SU R                   S35      eT	c
  [        U SS9OT	nU U 3n[        R                  " U5      n[        U5        T	b  [        XP5        [        R                  " US5      nUR                  U5        [        XR                   5      n[#        XaXRUS	S
9nU R                  Ul        U R$                  Ul        U R&                  Ul        [        R(                  " XhR*                  S5      " [-        [.        R0                  " U5      5      5        [2        R4                  R7                  U[8        R:                  " [<        [.        R0                  " U5      5      5        U$ )NzDcustom_op(...)(func): Expected `func` to be a Python function, got: zcustom_op(qualname='z-', ...)(func): expected `func` to have name 'z' but got 'zX'. Please either change the name of `func` or the qualname that is passed to `custom_op`r   )mutates_argsFRAGMENTT_private_accessAutograd)inspect
isfunction
ValueErrortypeparse_qualnamevalidate_namespace__name__r   r   parsevalidate_schema validate_function_matches_schemalibraryLibrarydefinefind_ophandle_or_thrownamer   
__module____doc__impl_opnamer   weakrefproxyr   _C#_dispatch_set_report_error_callback	functoolspartialreport_error_callback)funcnsr;   schema
schema_strfunction_schemalibophandleresultr#   r"   s            r    innercustom_op.<locals>.inner;   s   !!$''""&t*/ 
 "(+2==D &xj 1!!%k$-- A+,  9F8Md4S`vfX&
(..z:($,_Coob*-

:)".B.BC#?(TXY-- OOS..*5'f(=>	
 	44i''(=w}}V?TU	
 r   )r!   )r"   r#   rO   s   `` r    r   r   3   s     )V Lr   r   global_registryc                   @  ^  \ rS rSrSrSS.U 4S jjrS rSS jrS rS	 r	S
 r
S rS r SS\R                  \\R                   \   4   S\R"                  4S jjrS rS\R"                  4S jrSS\R"                  4S jjrS rS rS rS rSS jrSS jrSrU =r$ )r   r   r&   Fr*   c                   > [         TU ]  5         [        5         U(       d  [        S5      eU SU 3nX0l        X l        Xl        XPl        X@l        Xpl	        S U l
        0 U l        SU l        U [        U R                  '   g )Nz|The CustomOp constructor is private and we do not guarantee BC for it. Please use custom_op(...) to create a CustomOp object::F)super__init__r!   RuntimeError_schema_cpp_ns_lib	_ophandler?   	_qualnamer3   _impls'_registered_autograd_kernel_indirectionrQ   )	selfrL   cpp_nsrI   operator_namerM   r+   r;   	__class__s	           r    rW   CustomOp.__init__w   s    S  M?+%(	5=)" DF7<4*.'r   c                     U R                   (       a   eU R                  R                  U R                  [	        [
        R                  " U 5      5      S5        SU l         g )Nr,   T)r_   r[   r>   r?   r   r@   rA   r`   s    r    %_register_autograd_kernel_indirection.CustomOp._register_autograd_kernel_indirection   sA    ????		t||%@tAT%UWab7;4r   c                 n   U R                  U5      (       aB  U R                  U   nUc   eUR                  n[        SU SU R                   SU SU S3	5      e[
        R                  " [        R                  " U5      5      nUR                   SUR                   3n[        X%5      U R                  U'   g )NzAttempting to register a z impl for operator z that already has a z  impl registered from Python at z. This is not supported.:)	_has_implr^   locationrX   r]   r-   getframeinfosys	_getframefilenamelinenoFuncAndLocation)r`   kindrG   
stacklevelfunc_and_locationrl   frames          r    _register_implCustomOp._register_impl   s    >>$ $D 1$000(11H+D61DT^^DT U&&*V+K*46 
 $$S]]:%>?nn%Qu||n5+D;Dr   c                      U R                   U   $ Nr^   r`   rs   s     r    	_get_implCustomOp._get_impl   s    {{4  r   c                     XR                   ;   $ rz   r{   r|   s     r    rk   CustomOp._has_impl   s    {{""r   c                     U ? [        [        R                  U R                  5      n[        XR                  5      (       a  [        XR                  5        [        U R                  	 g rz   )
r[   getattrr   opsrZ   hasattrr?   delattrrQ   r]   )r`   opnamespaces     r    _destroyCustomOp._destroy   sD     Ieii6;--K.DNN+r   c                 "    SU R                    S3$ )Nz<CustomOp(op="z")>)r]   rf   s    r    __repr__CustomOp.__repr__   s    /s33r   c                 N    [         R                  " U R                  /UQ70 UD6nU$ rz   )rB   _dispatch_call_boxedr\   )r`   argskwargsrN   s       r    __call__CustomOp.__call__   s'     ((I$I&Ir   device_typesr$   c                 t   ^ ^^ [        T[        5      (       a  T/mT H  n[        U5        M     UUU 4S jnU$ )r&   c                    > [        T5       H_  nTR                  U5        TR                  XTS9  [        U   n[        R
                  " TR                  TR                  U5      " U 5        Ma     U $ )Nrt   )set_check_doesnt_have_library_implrw   SUPPORTED_DEVICE_TYPE_TO_KEYr7   r>   r[   r?   )fdevice_typedispatch_key_stacklevelr   r`   s      r    rO   CustomOp.impl.<locals>.inner   sa    "<044[A##K{#K;KHTYYlCAF	  1
 Hr   )
isinstancestrvalidate_device_type)r`   r   r   r   rO   s   ```  r    r>   CustomOp.impl   s7     lC(((>L'K - (	 r   c                     U R                  U5      (       a  g [        U   n[        R                  " U R                  U5      (       a  [        SU SU R                   S35      eg )Nzimpl(..., device_types=z): the operator zs already has an implementation for this device type via a pre-existing torch.library or TORCH_LIBRARY registration.)rk   r   rB   ._dispatch_has_computed_kernel_for_dispatch_keyr]   rX   )r`   r   keys      r    r   (CustomOp._check_doesnt_have_library_impl   sj    >>+&&*;7<<T^^SQQ)+6Ft~~FV WL MN N Rr   c                    ^  U 4S jnU$ )z2Register an implementation for a factory function.c                    > TR                  SU 5        [        R                  " TR                  TR                  S5      " U 5        U $ )NfactoryBackendSelect)rw   r7   r>   r[   r?   )r   r`   s    r    rO   $CustomOp.impl_factory.<locals>.inner   s5    	1-LLDLL/B1EHr   r   )r`   rO   s   ` r    impl_factoryCustomOp.impl_factory   s    	
 r   c                    ^ ^ UU 4S jnU$ )r&   c                 .  >^ ^^ TR                  5         TR                  ST TS9  TR                  S5      R                  mTR                  m[
        R                  " T 5      U UU4S j5       nTR                  R                  TR                  US5        T $ )Nabstractr   c                     > UU4S jn[         R                  R                  R                  U5         T" U 0 UD6sS S S 5        $ ! , (       d  f       g = f)Nc                  &   > [        ST ST  35      e)Nz<Attempted to call get_ctx() for the meta implementation for a  .You have presumably called get_ctx() because the operator has a data-dependent output shape; if so, there is no such meta implementation and this error is the correct behavior. Otherwise, please remove the call to get_ctx() in the implementation registered with impl_abstract at rX   )rl   r"   s   r    error_on_ctxOCustomOp.impl_abstract.<locals>.inner.<locals>.f_with_ctx.<locals>.error_on_ctx   s+    &'j ) 'Z)	 	r   )r   _library	fake_implset_ctx_getter)r   r   r   r   rl   r"   s      r    
f_with_ctx9CustomOp.impl_abstract.<locals>.inner.<locals>.f_with_ctx   s<    
 ^^--<<\Jd-f- KJJs   A
AMeta)
$_check_doesnt_have_library_meta_implrw   r}   rl   r]   rD   wrapsr[   r>   r?   )r   r   rl   r"   r   r`   s   ` @@r    rO   %CustomOp.impl_abstract.<locals>.inner   s}    557
A+F~~j1::H~~H __Q.  .  IINN4<<V<Hr   r   r`   r   rO   s   `` r    impl_abstractCustomOp.impl_abstract   s    
	8 r   c                   ^ ^ UU 4S jnT R                   mTR                  5       [        R                  :w  a  U" S5        TR                  nTR                  (       d  U" S5        [        U5      S:  d   e[        S U 5       5      nU(       a  U" S5        [        [        R                  5      S[        [        R                  5      S[        [        R                  5      S	[        [        R                  5      S
[        [        R                  5      S[        [        [        R                  5      S 5      S0nTR                   HE  nUR                  U;   a  M  U" S[!        UR#                  5       5       SUR                   S35        MG     g )Nc                 @   > [        SU  STR                   ST 35      e)NzCCannot use torch._custom_ops APIs to register backward formula for z. Got operator z with schema: )rX   r]   )detailrI   r`   s    r    error4CustomOp._check_can_register_backward.<locals>.error  s1    %ho>>".: r   znon-functional operatorzoperator with no returnsr   c              3      #    U  H4  oR                   S L=(       a    UR                   R                  (       + v   M6     g 7frz   )
annotationis_write).0rs     r    	<genexpr>8CustomOp._check_can_register_backward.<locals>.<genexpr>#  s/      #
LPqLL$BQ\\-B-B)BBDs   <>zoperator that returns viewsintSymIntboolfloatTensorzList[Tensor]zoperator with return not in z (got ))rY   rs   r   
functionalreturnslenanyr   r   r   r   r   r   r   r   r0   listvalues)r`   r   retsis_non_mutating_viewallowed_return_typesretrI   s   `     @r    _check_can_register_backward%CustomOp._check_can_register_backward  s6   	 ;;=J111+,~~~~,-4y1}}" #
LP#
  
  /0 VZZ %V]]#XV[[!6V\\"GV]]#XXfmm,d3^ 
 >>Cxx//06J6Q6Q6S1T0UU[\_\d\d[eefgh "r   c                 <   U R                   (       a  g [        R                  " U R                  S5      (       a  [	        SU R                   S35      eS HE  n[        R                  " U R                  U5      (       d  M+  [	        SU R                   SU S35      e   g )NCompositeImplicitAutogradz3impl_backward/impl_save_for_backward: the operator a3   already has an implementation for this device type via a pre-existing registration to DispatchKey::CompositeImplicitAutograd.CompositeImplicitAutograd operators do not need an autograd formula; instead, the operator will decompose into its constituents and those can have autograd formulas defined on them.)r,   AutogradCPUAutogradCUDAz; already has an Autograd kernel registered to DispatchKey::z vi a pre-existing torch.library or TORCH_LIBRARY registration. Please either remove those registrations or don't use the torch._custom_ops APIs)r_   rB   %_dispatch_has_kernel_for_dispatch_keyr]   rX   )r`   r   s     r    (_check_doesnt_have_library_autograd_impl1CustomOp._check_doesnt_have_library_autograd_impl7  s    7733DNND_``EdnnEU V> ?@ @ ?C77LL"$$(NN#3 4225 7YZ[ [ ?r   c                    U R                  S5      (       a  g [        R                  " U R                  S5      (       a'  [        R                  " U R                  S5      (       d  g [        R                  " U R                  S5      (       a  [	        SU R                   S35      e[        R                  " U R                  S5      (       a  [	        SU R                   S35      eg )Nr   CompositeExplicitAutogradr   r   z!impl_abstract(...): the operator a-   already has an implementation for this device type via a pre-existing registration to DispatchKey::CompositeImplicitAutograd.CompositeImplicitAutograd operators do not need an abstract impl; instead, the operator will decompose into its constituents and those can have abstract impls defined on them.z already has an DispatchKey::Meta implementation via a pre-existing torch.library or TORCH_LIBRARY registration. Please either remove that registration or don't call impl_abstract.)rk   rB   r   r]   rX   rf   s    r    r   -CustomOp._check_doesnt_have_library_meta_implO  s    >>*%% 44T^^E`aa<<T^^VTT 33DNND_``3DNN3C D; <= = 33DNNFKK3DNN3C DV WX X Lr   c           
      Z   U R                  S5      (       d   eU R                  S5      (       d   e[        U R                  U R                  U [	        U R
                  5      U R                  S5      R                  U R                  S5      R                  5      nU R                  SU5        g )Nbackwardsave_for_backwardautograd)	rk   r   rY   _output_differentiabilityget_opr]   r}   rG   rw   )r`   kernels     r    _register_autograd_kernel"CustomOp._register_autograd_kernelx  s    ~~j))))~~12222*LL**4>>"NN./44NN:&++- 	J/r   c                    ^ ^ UU 4S jnU$ )ziRegister a function that tells us what to save for backward.

Please see impl_backward for more details.
c                    > TR                  5         TR                  5         TR                  (       d  TR                  5         TR	                  SU TS9  TR                  S5      (       a  TR                  5         g g )Nr   r   r   )r   r   r_   rg   rw   rk   r   )r   r   r`   s    r    rO   .CustomOp.impl_save_for_backward.<locals>.inner  sf    --/99;??::< 3Q;O~~j))..0 *r   r   r   s   `` r    impl_save_for_backwardCustomOp.impl_save_for_backward  s    
	1 r   c                   ^ ^^ Tb|  U4S jn[        T[        5      (       d  U" 5         T H!  n[        U[        5      (       a  M  U" 5         M#     [        T R                  R
                  5      [        T5      :w  a  U" 5         UUU 4S jnU$ )r&   c                      > [        ST  35      e)Nzimpl_backward(output_differentiability): expected output_differentiability to be a list of bools with length equal to the number of outputs of this CustomOp got: r   )output_differentiabilitys   r    yell$CustomOp.impl_backward.<locals>.yell  s"    " 5578 8r   c                   > TR                  5         TR                  5         TR                  (       d  TR                  5         TR	                  SU TS9  TTl        TR                  S5      (       a  TR                  5         g g )Nr   r   r   )r   r   r_   rg   rw   r   rk   r   )r   r   r   r`   s    r    rO   %CustomOp.impl_backward.<locals>.inner  sn    --/99;??::<
A+F-ED*~~122..0 3r   )r   r   r   r   rY   r   )r`   r   r   r   diffrO   s   ```   r    impl_backwardCustomOp.impl_backward  sq     $/8 6==0!$--F 1 4<<''(C0H,II	1 r   )
r3   rZ   r^   r[   r\   r?   r   r]   r_   rY   )   )Nr  )r3   r<   __qualname____firstlineno__r=   rW   rg   rw   r}   rk   r   r   r   typingUnionr   IterableCallabler>   r   r   r   r   r   r   r   r   r   __static_attributes____classcell__)rc   s   @r    r   r   r   s     Y^ / /4<<!#,4 RS"LLfooc.B)BC	*Nfoo !foo !F#iJ[0"XR
0 r   c                   >    \ rS rSr% \R
                  \S'   \\S'   Srg)rr   i  rG   rl   r   N)	r3   r<   r  r  r  r  __annotations__r   r  r   r   r    rr   rr     s    
//Mr   rr   ra   rb   c                     UR                   c  SOUR                   n[        R                  " U  S[        UR                  5       3U5      $ )N rU   )overload_namerB   _dispatch_find_schema_or_throwr   r;   )ra   rb   r  s      r    r:   r:     sN    ))1}7R7R  ,,("S++,-. r   rH   c                 f    SU ;   a  [        SU  S35      eU [        ;   a  [        SU  SU  S35      eg )N.zcustom_op(..., ns="zC"): expected ns to not contain any . (and be a valid variable name)zcustom_op(..., ns='z'): 'z9' is a reserved namespace, please choose something else. )r/   RESERVED_NS)rH   s    r    r2   r2     sZ    
by!" &# $
 	
 
[!"U2$ /- .
 	
 r   rI   c                     [         R                  R                  R                  U 5      (       d  [	        SU  35      eU R
                  R                  b  [	        SU  35      eg )Nzcustom_op only supports functional operators (ops that do not mutate any inputs, do not return views of the inputs, and has at least one return). Got the following non-functional schema: zUcustom_op does not support arguments named 'self'. Please rename your argument. Got: )r   r   utilsis_functional_schemar/   	argumentsself_arg)rI   s    r    r5   r5     sq    >>44V<<8 9?xA
 	
   ,**03
 	
 -r   c                     U R                  SS5      n[        U5      S:w  a  [        SU  S35      eSUS   ;   a  [        SU  35      eUS   US   4$ )	NrU   r
   r  z$Expected there to be a namespace in z;, i.e. The operator name should look something like ns::foor  zThe torch.custom_ops APIs do not handle overloads, i.e. operator names with '.' in them. Please name your operator something like ns::foo. Got: r   )splitr   r/   )r"   namess     r    r1   r1     s~    NN4#E
5zQ?z JL M N 	N
eAh ! "*
, - 	- 8U1Xr   r   c                 `    U [         ;  a$  [        SU  S[         R                  5        S35      eg )NzCustomOp.impl(device_types=[z(, ...]): we only support device_type in r  )r   r/   keys)r   s    r    r   r     s?    66*;- 8.3356a9
 	
 7r   paramc                     U R                   [        R                  R                  [        R                  R                  4;   $ rz   )rs   r-   	ParameterPOSITIONAL_OR_KEYWORDKEYWORD_ONLY)r  s    r    supported_paramr"    s6    :://&&  r   rG   c                   ^ ^^^	 [         R                  " U5      m	[        S T	R                  R	                  5        5       5      (       d  [        ST	 35      e[        S T	R                  R	                  5        5       5      (       d'  T	R                  [         R                  R                  La  [        ST	 35      eT	R                  R	                  5        VVs/ s H2  u  p#UR                  [         R                  R                  :X  d  M/  X#4PM4     nnnT	R                  R	                  5        VVs/ s H2  u  p#UR                  [         R                  R                  :X  d  M/  X#4PM4     nnnU U	4S jmU U	4S jmUU4S jnU" UT R                  R                  5        U" UT R                  R                   5        g s  snnf s  snnf )Nc              3   <   #    U  H  u  p[        U5      v   M     g 7frz   )r"  r   _ps      r    r   3validate_function_matches_schema.<locals>.<genexpr>   s     E.Ddaq!!.Ds   zcustom_op(..., manual_schema)(func): positional-only args, varargs, and kwargs are not supported. Please rewrite `func` to not have them. Got `func` with signature: c              3   r   #    U  H-  u  pUR                   [        R                  R                  Lv   M/     g 7frz   )r   r-   r  emptyr%  s      r    r   r(    s.      
. LL 1 1 7 77.s   57zcustom_op(..., manual_schema)(func): When passing in a manual schema, we expect `func` to have no type annotations to avoid ambiguity. Got `func` with signature: c                  &   > [        ST ST  35      e)Nzcustom_op(..., manual_schema)(func): When passing in a manual schema, we expect `func`'s signature to match `manual_schema` (aside from type annotations). func's signature: , manual_schema: r/   rI   sigs   r    r   /validate_function_matches_schema.<locals>.error  )    ! "%%6vh@
 	
r   c                  &   > [        ST ST  35      e)Nzycustom_op(..., manual_schema)(func): neither func nor manual_schema should have default arguments. Got func's signature: r,  r-  r.  s   r    error_default_args<validate_function_matches_schema.<locals>.error_default_args'  r1  r   c                   > [        U 5      [        U5      :w  a  T" 5         [        X5       H[  u  u  p#nX$R                  :w  a  T" 5         UR                  [        R
                  R                  Ld  UR                  c  MT  T" 5         M]     g rz   )r   zipr;   defaultr-   r  r*  )sig_argsschema_argsr;   r  argr   r3  s        r    compare1validate_function_matches_schema.<locals>.compare/  se    x=C,,G"%h"<MT3xx}}G$5$5$;$;;s{{?V"$	 #=r   )r-   	signatureall
parametersitemsr/   r   return_annotation	Signaturer*  rs   r  r   r!  r  flat_positionalflat_kwarg_only)
rI   rG   r;   r  
positional	kwargonlyr;  r   r3  r/  s
   `      @@@r    r6   r6     s    

D
!CEcnn.B.B.DEEE<<?5B
 	
 	 
,,.
 	
 	
   (9(9(?(??558E;
 	
 >>//11KD::**@@@ 	1   >>//11KD::**777 	1  

% J((889Iv''778K
s   .F>F>2.G$Gr   r   c           
          US:X  a  [        U  S35      eUS:X  a  [        U  S35      eUS;   a'  UR                  5       n[        U  SU SU SU S	35      e[        U  S
U S35      e)N	Undefineda  : There were no Tensor inputs to this operator (e.g. you passed an empty list of Tensors). If your operator is a factory function (that is, it takes no Tensors and constructs a new one), then please use CustomOp.impl_factory to register an implementation for itr   z: when running with device='Meta' tensors: there is no abstract impl registered for this CustomOp. Please register one via CustomOp.impl_abstract to get this CustomOp to work with Meta tensors)r   r   z: when running with device='z' tensors: there is no zW impl registered for this CustomOp. Please register one via CustomOp.impl(device_type='z')z%: No implementation for dispatch key z. It is likely that we have not added this functionality yet, please either open an issue or if you're feeling adventurous, use the low-level torch.library API)NotImplementedErrorlower)r   r   devices      r    rF   rF   <  s    
k!k ' (
 	
 f}!k T U
 	

 o!k5fX=Th **05
 	

 +:3% @ 	 r   c           	      4   U R                   n[        R                  R                  US5      nU R	                  5       R                  S5      S   n[        U R                  5      nUR                  S5      S   n[        R                  " U5      n[        X!XSU SS9$ )Nr)   rU   Tr*   )	namespacer   r7   r8   r;   r  r   rY   r   r4   r   )oprH   rL   r;   rJ   rI   s         r    custom_op_from_existingrP  Z  s}    	B
--

J
/C779??4 $DRZZJ!!$'+J!!*-FCV2tDDr   c                 6  ^  U 4S jn[        T 5      u  p#[        [        R                  U5      (       d  U" 5         [	        [        R                  U5      n[        XC5      (       d  U" 5         [	        XC5      n[        US5      (       d  U" 5         UR
                  $ )Nc                  "   > [        ST  S35      e)NzCould not find the operator z~. Please make sure you have already registered the operator and (if registered from C++) loaded it via torch.ops.load_library.r-  )r"   s   r    error_not_foundget_op.<locals>.error_not_foundf  s!    *8* 54 56 	6r   r7  )r1   r   r   r   r   r7  )r"   rS  rH   r;   r   packets   `     r    r   r   e  su    6 h'HB599b!!%))R(K;%%['F69%%>>r   c                     U [         ;   a	  [         U    $ U(       d  [        SU  S35      e[        U 5      n[        U5      nU$ )NzCould not find custom op "z5". Did you register it via the torch._custom_ops API?)rQ   rX   r   rP  )r"   also_check_torch_libraryoverloadrN   s       r    _find_custom_oprY  x  sQ    ?"x((#(
 3) *+ 	+ hH$X.FMr   c                    U [         R                  R                  R                  ;  a  g [         R                  R                  R                  U    nUc  g UR	                  S5      (       d  g UR                  S5      R                  $ )Nr   )r   
_custom_opr>   rQ   rk   r}   rG   )r"   r   s     r    get_abstract_implr\    so    u'',,<<<  %%55h?Iz**z*///r   c           	      0   U R                  S5      u  p4U U 3n[        R                  " U5      n[        U5        U(       a%  [        R
                  R                  R                  /O/ n[        R                  " US5      nUR                  XWS9  [        X6R                  5      n	[        XXdU	SS9n
U
R                  5         [        R
                  R                  U	[         R"                  " [$        [&        R(                  " U
5      5      5        [+        U 5      $ )NrU   r)   )tagsTr*   )r  r   r4   r5   r   rB   Tagneeds_fixed_stride_orderr7   r8   r9   r:   r;   r   rg   rC   rD   rE   rF   r@   rA   r   )r"   rI   r`  rH   r;   rJ   rK   r^  rL   rM   rN   s              r    _custom_op_with_schemara    s    ~~d#HB6&"J$**:6OO$6NEHHLL112TVD
//"j
)CJJzJ%%b*>*>?HchPTUF
002	HH00)##$97==;PQ (r   rz   )F)T)8dataclassesrD   r-   rn   r  r@   r   torchgen.modelr   r   r   r   r   r   r   torch._CrB   torch.libraryr7   r	   r   r   r   torch._library.infer_schemar   __all__r   r  r!   r   Optionalr  r   rQ   dictr  r   	dataclassrr   r:   r2   r5   tupler1   r   r  r   r"  r6   AnyrF   rP  r   rY  r\  ra  r   r   r    <module>rm     s      
    _ _    ! L " 4
 /   M :>33"(//#"63__3x *,c:o& +~ ~B
   
3 | 

3 

4 


N 
t 
"
S 
U38_ 

c 
d 
7,,  >9>9"(//>9	>9BVZZ c d <E&	0r   