
    N j                     2   S SK r S SKr\R                  R                  SS5      r\R                  S5        \R                  R                  \SS5      \R                  R                  \SS5      S\R                  S	\S
\R                  4S j5       5       r	S r
g)    NexportFRAGMENTzLaccess_subclass_inner_tensor(Tensor src_subclass_tensor, str attr) -> Tensoraccess_subclass_inner_tensorAutogradPythonsrc_subclass_tensorattrreturnc                     SSK Jn  U" U 5      (       d  [        S[        U 5       35      e[	        XS 5      nUb  [        U[        R                  5      (       d  [        SU SU  35      eU$ )Nr   )is_traceable_wrapper_subclasszIExpected src_subclass_tensor to be a traceable wrapper subclass, but got z
Attribute z% is not a tensor or doesn't exist in )	torch.utils._python_dispatchr   AssertionErrortypegetattr
isinstancetorchTensorRuntimeError)r   r	   r   vals       h/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/torch/export/custom_ops.py_access_subclass_inner_tensorr      s     K()<==/013
 	
 %T
2C
{*S%,,77CDWCXY
 	
 J    c                     U R                  SS5      u  p4[        R                  " U5      n[        XT5      n[	        US5      (       d  [        SU  S35      eUR                  " U0 UD6$ )aA  
Import a custom autograd function by string name and call it. This is pretty bad
because:
1) There is no schema

Ideally we should automatically wrap custom autograd functions with a custom op, but
that is too much work because we need to schematize custom autograd functions. For now,
we just hackily put it in the IR.
.   applyzExpected function class z to have 'apply' method)rsplit	importlibimport_moduler   hasattrr   r   )function_cls_nameargskwargsmodule_name
class_namemodulefunction_clss          r   ._call_custom_autograd_function_in_pre_dispatchr(   $   sv     066sA>K $$[1F6.L<))&'8&99PQ
 	
 t.v..r   )r   r   libraryLibrarylibdefineimplr   strr   r(    r   r   <module>r0      s      mmHj1 

R
 C7D C7B-0
\\ C E$/r   