
    /j                     ,   d dl Z d dlZej                            dd          Ze                    d           ej                            edd          ej                            edd          dej        d	ed
ej        fd                        Z	d Z
dS )    NexportFRAGMENTzLaccess_subclass_inner_tensor(Tensor src_subclass_tensor, str attr) -> Tensoraccess_subclass_inner_tensorAutogradPythonsrc_subclass_tensorattrreturnc                     ddl m}  ||           st          dt          |                      t	          | |d           }|t          |t          j                  st          d| d|            |S )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       \/home/longshao/multi-rider-rag/.venv/lib/python3.11/site-packages/torch/export/custom_ops.py_access_subclass_inner_tensorr      s     KJJJJJ(()<== 
3/003 3
 
 	
 %tT
2
2C
{*S%,77{YYYDWYY
 
 	
 J    c                     |                      dd          \  }}t          j        |          }t          ||          }t	          |d          st          d|  d           |j        |i |S )a]  
    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(   $   s     066sA>>K $[11F6:..L<)) 
Q'8QQQ
 
 	
 <t.v...r   )r   r   libraryLibrarylibdefineimplr   strr   r(    r   r   <module>r0      s         mHj11 

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