
    `ig                         d dl mZmZmZmZ dddZd Z G d de          Z G d d	e          Z G d
 de          Z	 G d de          Z
dS )    )BinaryUfuncInfoOpInfoReductionOpInfoUnaryUfuncInfoNop_dbc                T    |ddl m} |D ]}|j        | k    r|j        |k    r|c S dS )zH
    Finds the OpInfo with the given name that has no variant name.
    Nr   r   )2torch.testing._internal.common_methods_invocationsr   namevariant_test_name)referenced_namevariant_namer   opinfos       w/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/torch/testing/_internal/opinfo/refs.py_find_referenced_opinfor   "   sX     }LLLLLL  ;/))f.F,.V.VMMM     c                 B   | |d d d dd}|                                 }d|v r|                    |d                    |d= d|v r|d= d|v r|d= d|v r|d= d|v r|d= |                    |           |                    |           d|d<   d|d	<   d|d
<   d|d<   d|d<   |S )NF)r   opaliasesmethod_variantinplace_variantsupports_scriptingkwargsself	__class__skips
decoratorssupports_autogradsupports_gradgradsupports_fwgrad_bwgradsupports_inplace_autogradsupports_forward_ad)copyupdate)r   r   	inherited	overridescommon_kwargsr   s         r   _inherit_constructor_argsr(   1   s    # M ^^F 6fX&'''86Nf;&7Ov<  MM-   
MM)
 #(F"'F',F#$*/F&'$)F !Mr   c                   .     e Zd ZdZddddd fd
Z xZS )PythonRefInfozM
    An OpInfo for a Python reference of an OpInfo base class operation.
    N Tr   r   torch_opinfo_variant_namevalidate_view_consistencyc                   || _         || _        t          |||          | _        || _        t          | j        t                    sJ | j        j        }t          ||||          }	 t                      j
        di |	 d S Nr    )torch_opinfo_namer-   r   torch_opinfor.   
isinstancer   _original_opinfo_argsr(   super__init__r   r   r   r   r2   r-   r.   r   r%   ukwargsr   s             r   r7   zPythonRefInfo.__init__a   s     "3)B&38
 
 
 *C&$+V44444%;	+D"iHH##7#####r   __name__
__module____qualname____doc__r7   __classcell__r   s   @r   r*   r*   \   sZ          "$"&$ $ $ $ $ $ $ $ $ $ $r   r*   c                   ,     e Zd ZdZdddd fd
Z xZS )ReductionPythonRefInfoM
    An OpInfo for a Python reference of an elementwise unary operation.
    Nr+   r   r   r-   c                   || _         || _        t          |||          | _        t	          | j        t
                    sJ | j        j        }t          ||||          }d| _         t                      j
        di | d S )Nr   Fr1   )r2   r-   r   r3   r4   r   _original_reduction_argsr(   r.   r6   r7   
r   r   r   r   r2   r-   r   r%   r9   r   s
            r   r7   zReductionPythonRefInfo.__init__~   s     "3)B&38
 
 
 $+_=====%>	+D"iHH */&##7#####r   r:   r@   s   @r   rB   rB   y   sW          "$$ $ $ $ $ $ $ $ $ $ $r   rB   c                   .     e Zd ZdZddddd fd
Z xZS )ElementwiseUnaryPythonRefInforC   Nr+   Tr,   c                   || _         || _        t          |||          | _        || _        t          | j        t                    sJ | j        j        }t          ||||          }	 t                      j
        di |	 d S r0   )r2   r-   r   r3   r.   r4   r   _original_unary_ufunc_argsr(   r6   r7   r8   s             r   r7   z&ElementwiseUnaryPythonRefInfo.__init__   s     "3)B&38
 
 
 *C&$+^<<<<<%@	+D"iHH##7#####r   r:   r@   s   @r   rI   rI      sZ          "$"&$ $ $ $ $ $ $ $ $ $ $r   rI   c                   ,     e Zd ZdZdddd fd
Z xZS )ElementwiseBinaryPythonRefInfozN
    An OpInfo for a Python reference of an elementwise binary operation.
    Nr+   rD   c                    || _         || _        t          |||          | _        t	          | j        t
                    sJ | j        j        }t          ||||          } t                      j	        di | d S r0   )
r2   r-   r   r3   r4   r   _original_binary_ufunc_argsr(   r6   r7   rG   s
            r   r7   z'ElementwiseBinaryPythonRefInfo.__init__   s     "3)B&38
 
 
 $+_=====%A	+D"iHH##7#####r   r:   r@   s   @r   rM   rM      sW          "$$ $ $ $ $ $ $ $ $ $ $r   rM   )#torch.testing._internal.opinfo.corer   r   r   r   r   r(   r*   rB   rI   rM   r1   r   r   <module>rQ      s#             > EI     ( ( (V$ $ $ $ $F $ $ $:$ $ $ $ $_ $ $ $>$ $ $ $ $N $ $ $<$ $ $ $ $_ $ $ $ $ $r   