
    sgg                         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
y)    )BinaryUfuncInfoOpInfoReductionOpInfoUnaryUfuncInfoNop_dbc                h    |ddl m} |D ]%  }|j                  | k(  s|j                  |k(  s#|c S  y)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       V/var/www/html/venv/lib/python3.12/site-packages/torch/testing/_internal/opinfo/refs.py_find_referenced_opinfor   "   s9     }L ;;/)f.F.F,.VM    c                    | |d d d dd}|j                         }d|v r|j                  |d          |d= d|v r|d= d|v r|d= d|v r|d= d|v r|d= |j                  |       |j                  |       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        
| (  di |	 y 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%%;;	+D"iH#7#r   __name__
__module____qualname____doc__r7   __classcell__r   s   @r   r*   r*   \   s      "$"&$ $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        	| (  di | y )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 */&#7#r   r:   r@   s   @r   rB   rB   y   s     "$$ $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        
| (  di |	 y 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#7#r   r:   r@   s   @r   rI   rI      s      "$"&$ $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        	| $  di | y r0   )
r2   r-   r   r3   r4   r   _original_binary_ufunc_argsr(   r6   r7   rG   s
            r   r7   z'ElementwiseBinaryPythonRefInfo.__init__   ss     "3)B&38
 $++_===%%AA	+D"iH#7#r   r:   r@   s   @r   rM   rM      s     "$$ $r   rM   )#torch.testing._internal.opinfo.corer   r   r   r   r   r(   r*   rB   rI   rM   r1   r   r   <module>rQ      sQ    > EI (V$F $:$_ $>$N $<$_ $r   