U
    rh                     @  sH   d dl mZ d dlZd dlZd dlmZ d dlmZ G dd deZ	dS )    )annotationsN)Base)expectc                   @  sf   e Zd ZeddddZeddddZeddddZeddd	d
ZeddddZdS )ReduceSumSquareNone)returnc                  C  s  dddg} t jdgt jd}d}tjjdddgd	g|d
}t jddgddggddgddggddgddgggt jd}t jt |t	||dkd}t
|||g|gdd t jd t jdd| t j}t jt |t	||dkd}t
|||g|gdd d S )N         Zdtyper   r   dataaxesreducedinputsoutputskeepdims               	   
         Zaxisr   Z.test_reduce_sum_square_do_not_keepdims_exampler   r   nameZ-test_reduce_sum_square_do_not_keepdims_randomnparrayint64onnxhelper	make_nodefloat32sumsquaretupler   randomseeduniformastypeshaper   r   noder   r    r2   O/tmp/pip-unpacked-wheel-xnis5xre/onnx/backend/test/case/node/reducesumsquare.pyexport_do_not_keepdims   s:    
, z&ReduceSumSquare.export_do_not_keepdimsc                  C  s  dddg} t jdgt jd}d}tjjdddgdg|d	}t jddgdd
ggddgddggddgddgggt jd}t jt |t	||dkd}t
|||g|gdd t jd t jdd| t j}t jt |t	||dkd}t
|||g|gdd d S )Nr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Z'test_reduce_sum_square_keepdims_exampler   r   r   Z&test_reduce_sum_square_keepdims_randomr    r/   r2   r2   r3   export_keepdims6   s:    
, zReduceSumSquare.export_keepdimsc                  C  s   dddg} t jg t jd}d}tjjdddgdg|d	}t jddgdd
ggddgddggddgddgggt jd}t jt |d |dkd}t	|||g|gdd t j
d t j
dd| t j}t jt |d |dkd}t	|||g|gdd d S )Nr   r	   r   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Z4test_reduce_sum_square_default_axes_keepdims_exampler   r   r   Z3test_reduce_sum_square_default_axes_keepdims_random)r!   r"   r#   r$   r%   r&   r'   r(   r)   r   r+   r,   r-   r.   r/   r2   r2   r3   export_default_axes_keepdims^   s:    
, z,ReduceSumSquare.export_default_axes_keepdimsc                  C  s  dddg} t jdgt jd}d}tjjdddgd	g|d
}t jddgddggddgddggddgddgggt jd}t jt |t	||dkd}t
|||g|gdd t jd t jdd| t j}t jt |t	||dkd}t
|||g|gdd d S )Nr   r	   r   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Z5test_reduce_sum_square_negative_axes_keepdims_exampler   r   r   Z4test_reduce_sum_square_negative_axes_keepdims_randomr    r/   r2   r2   r3   export_negative_axes_keepdims   s:    
, z-ReduceSumSquare.export_negative_axes_keepdimsc                  C  s   dddg} d}dddg}t jjdddgdg|d	}tjg tjd
| }tjdgtjd
}ttj|tjd
}t	|||g|gdd d S )Nr	   r   r   r
   r   r   r   r   r   r   Z test_reduce_sum_square_empty_setr   )
r$   r%   r&   r!   r"   r'   Zreshaper#   zerosr   )r0   r   Zreduced_shaper1   r   r   r   r2   r2   r3   export_empty_set   s$    

z ReduceSumSquare.export_empty_setN)	__name__
__module____qualname__staticmethodr4   r5   r6   r8   r:   r2   r2   r2   r3   r      s   ''%'r   )

__future__r   Znumpyr!   r$   Zonnx.backend.test.case.baser   Zonnx.backend.test.case.noder   r   r2   r2   r2   r3   <module>   s
   