o
    wZhg                     @   sr   d dl mZmZmZmZ ddddZdd ZG dd	 d	eZG d
d deZG dd deZ	G dd deZ
dS )    )BinaryUfuncInfoOpInfoReductionOpInfoUnaryUfuncInfoNop_dbc                C   s>   |du r
ddl m} |D ]}|j| kr|j|kr|  S qdS )zH
    Finds the OpInfo with the given name that has no variant name.
    Nr   r   )Z2torch.testing._internal.common_methods_invocationsr   nameZvariant_test_name)Zreferenced_nameZvariant_namer   Zopinfo r	   R/var/www/auris/lib/python3.10/site-packages/torch/testing/_internal/opinfo/refs.py_find_referenced_opinfo"   s   r   c                 C   s   | |d d d dd}|  }d|v r||d  |d= d|v r"|d= d|v r)|d= d|v r0|d= d|v r7|d= || || d|d< d|d	< d|d
< d|d< d|d< |S )NF)r   opaliasesZmethod_variantZinplace_variantZsupports_scriptingkwargsself	__class__skipsZ
decoratorsZsupports_autogradZsupports_gradgradZsupports_fwgrad_bwgradZsupports_inplace_autogradZsupports_forward_ad)copyupdate)r   r   	inheritedZ	overridesZcommon_kwargsr   r	   r	   r
   _inherit_constructor_args1   s6   


r   c                       ,   e Zd ZdZddddd fdd
Z  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|||d| _|| _t| jtsJ | jj}t||||}	t	 j
di |	 d S Nr   r	   )torch_opinfo_namer   r   torch_opinfor   
isinstancer   Z_original_opinfo_argsr   super__init__
r   r   r   r   r   r   r   r   r   ukwargsr   r	   r
   r"   a   s   zPythonRefInfo.__init____name__
__module____qualname____doc__r"   __classcell__r	   r	   r%   r
   r   \       r   c                       *   e Zd ZdZdddd fdd
Z  ZS )ReductionPythonRefInfoM
    An OpInfo for a Python reference of an elementwise unary operation.
    Nr   r   r   r   c          	         s^   || _ || _t|||d| _t| jtsJ | jj}t||||}d| _t	 j
di | d S )Nr   Fr	   )r   r   r   r   r    r   Z_original_reduction_argsr   r   r!   r"   	r   r   r   r   r   r   r   r   r$   r%   r	   r
   r"   ~   s   
zReductionPythonRefInfo.__init__r&   r	   r	   r%   r
   r.   y       r.   c                       r   )ElementwiseUnaryPythonRefInfor/   Nr   Tr   c          
         r   r   )r   r   r   r   r   r    r   Z_original_unary_ufunc_argsr   r!   r"   r#   r%   r	   r
   r"      s   z&ElementwiseUnaryPythonRefInfo.__init__r&   r	   r	   r%   r
   r3      r,   r3   c                       r-   )ElementwiseBinaryPythonRefInfozN
    An OpInfo for a Python reference of an elementwise binary operation.
    Nr   r0   c          	         sX   || _ || _t|||d| _t| jtsJ | jj}t||||}t j	di | d S r   )
r   r   r   r   r    r   Z_original_binary_ufunc_argsr   r!   r"   r1   r%   r	   r
   r"      s   
z'ElementwiseBinaryPythonRefInfo.__init__r&   r	   r	   r%   r
   r4      r2   r4   )Z#torch.testing._internal.opinfo.corer   r   r   r   r   r   r   r.   r3   r4   r	   r	   r	   r
   <module>   s   +