o
    soi                     @  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                   @  sR   e Zd ZedddZedddZedddZedd	d
ZedddZdS )ReduceSumSquarereturnNonec                  C  s  g d} 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      r
      dtyper   r   dataaxesreducedinputsoutputskeepdimsr
   r	                  	   
         axisr   .test_reduce_sum_square_do_not_keepdims_exampler   r   name-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    r7   _/home/ubuntu/.local/lib/python3.10/site-packages/onnx/backend/test/case/node/reducesumsquare.pyexport_do_not_keepdims   8   0
z&ReduceSumSquare.export_do_not_keepdimsc                  C  s  g d} 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   r   'test_reduce_sum_square_keepdims_exampler!   r   r#   &test_reduce_sum_square_keepdims_randomr%   r4   r7   r7   r8   export_keepdims6   r:   zReduceSumSquare.export_keepdimsc                  C  s   g d} 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   r   4test_reduce_sum_square_default_axes_keepdims_exampler!   r   r#   3test_reduce_sum_square_default_axes_keepdims_random)r&   r'   r(   r)   r*   r+   r,   r-   r.   r   r0   r1   r2   r3   r4   r7   r7   r8   export_default_axes_keepdims^   s8   0
z,ReduceSumSquare.export_default_axes_keepdimsc                  C  s  g d} 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   r   5test_reduce_sum_square_negative_axes_keepdims_exampler!   r   r#   4test_reduce_sum_square_negative_axes_keepdims_randomr%   r4   r7   r7   r8   export_negative_axes_keepdims   r:   z-ReduceSumSquare.export_negative_axes_keepdimsc                  C  s   g d} d}g d}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 )N)r
   r   r   r   )r
   r   r   r   r   r   r   r   r    test_reduce_sum_square_empty_setr!   )
r)   r*   r+   r&   r'   r,   reshaper(   zerosr   )r5   r   reduced_shaper6   r   r   r   r7   r7   r8   export_empty_set   s$   
z ReduceSumSquare.export_empty_setN)r   r   )	__name__
__module____qualname__staticmethodr9   r=   r@   rD   rI   r7   r7   r7   r8   r      s    ''%'r   )

__future__r   numpyr&   r)   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   r7   r7   r7   r8   <module>   s   