
    bIg|                    N    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e      Z	y)    )annotationsN)Base)expectc                  f    e Zd Zedd       Zedd       Zedd       Zedd       Zedd       Zy)ReduceL2c                 r   g d} t        j                  dgt         j                        }d}t        j                  j                  dddgdg|	      }t        j                  t        j                  d
t        j                  |       d
z   t         j                        |       }t        j                  t        j                  t        j                  |      t        |      |d
k(              }t        |||g|gd       t         j                  j!                  d       t         j                  j#                  dd|       j%                  t         j                        }t        j                  t        j                  t        j                  |      t        |      |d
k(              }t        |||g|gd       y )N      r   r   dtyper   r   dataaxesreducedinputsoutputskeepdims   aaxisr   &test_reduce_l2_do_not_keepdims_exampler   r   name
   %test_reduce_l2_do_not_keepdims_randomnparrayint64onnxhelper	make_nodereshapearangeprodfloat32sqrtsumsquaretupler   randomseeduniformastypeshaper   r   noder   r   s         a/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/backend/test/case/node/reducel2.pyexport_do_not_keepdimszReduceL2.export_do_not_keepdims   sM   xx288,{{$$F#K	 % 
 zz"))Arwwu~'9LeT ''FFRYYt_5;QO
 	$<I9		
 			qyy  b%077

C''FFRYYt_5;QO
 	$<I8		
    c                 r   g d} t        j                  dgt         j                        }d}t        j                  j                  dddgdg|	      }t        j                  t        j                  dt        j                  |       dz   t         j                        |       }t        j                  t        j                  t        j                  |      t        |      |dk(  
            }t        |||g|gd       t         j                  j!                  d       t         j                  j#                  dd|       j%                  t         j                        }t        j                  t        j                  t        j                  |      t        |      |dk(  
            }t        |||g|gd       y )Nr	   r   r   r   r   r   r   r   r   r    test_reduce_l2_keep_dims_exampler   r   r   r   test_reduce_l2_keep_dims_randomr   r2   s         r5   export_keepdimszReduceL2.export_keepdims;   sM   xx288,{{$$F#K	 % 
 zz"))Arwwu~'9LeT ''FFRYYt_5;QO
 	$<I3		
 			qyy  b%077

C''FFRYYt_5;QO
 	$<I2		
r7   c                 L   g d} t        j                  g t         j                        }d}t        j                  j                  dddgdg|      }t        j                  t        j                  dt        j                  |       dz   t         j                        |       }t        j                  t        j                  t        j                  |      d |dk(  	            }t        |||g|gd
       t         j                  j                  d       t         j                  j!                  dd|       j#                  t         j                        }t        j                  t        j                  t        j                  |      d |dk(  	            }t        |||g|gd       y )Nr	   r   r   r   r   r   r   r   r   ,test_reduce_l2_default_axes_keepdims_exampler   r   r   r   +test_reduce_l2_default_axes_keepdims_random)r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r   r.   r/   r0   r1   r2   s         r5   export_default_axes_keepdimsz%ReduceL2.export_default_axes_keepdimsh   s:   xx"((+{{$$/)x % 
 zz"))Arwwu~'9LeT ''"&&299T?TUVW 	$<I?		
 			qyy  b%077

C''"&&299T?TUVW$<I>		
r7   c                 r   g d} t        j                  dgt         j                        }d}t        j                  j                  dddgdg|	      }t        j                  t        j                  dt        j                  |       dz   t         j                        |       }t        j                  t        j                  t        j                  |      t        |      |dk(  
            }t        |||g|gd       t         j                  j!                  d       t         j                  j#                  dd|       j%                  t         j                        }t        j                  t        j                  t        j                  |      t        |      |dk(  
            }t        |||g|gd       y )Nr	   r   r   r   r   r   r   r   r   .test_reduce_l2_negative_axes_keep_dims_exampler   r   r   r   -test_reduce_l2_negative_axes_keep_dims_randomr   r2   s         r5   export_negative_axes_keepdimsz&ReduceL2.export_negative_axes_keepdims   sM   xxBHH-{{$$F#K	 % 
 zz"))Arwwu~'9LeT ''FFRYYt_5;QO
 	$<IA		
 			qyy  b%077

C''FFRYYt_5;QO
 	$<I@		
r7   c                    g d} d}g d}t         j                  j                  dddgdg|      }t        j                  g t        j
                  	      j                  |       }t        j                  dgt        j                  	      }t        j                  t        j                  |t        j
                  	            }t        |||g|gd
       y )N)r   r      r   )r   r   rF   r   r   r   r   r   r   test_reduce_l2_empty_setr   )
r#   r$   r%   r    r!   r)   r&   r"   zerosr   )r3   r   reduced_shaper4   r   r   r   s          r5   export_empty_setzReduceL2.export_empty_set   s    !{{$$F#K	 % 
 xx"**-55e<xx288,((288MDE$<I+		
r7   N)returnNone)	__name__
__module____qualname__staticmethodr6   r;   r?   rD   rJ    r7   r5   r   r      sh    *
 *
X *
 *
X !
 !
F *
 *
X 
 
r7   r   )

__future__r   numpyr    r#   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   rQ   r7   r5   <module>rV      s$    #   , .B
t B
r7   