
    NgY                     J    d dl Zd dlZd dlmZ d dlmZ  G d de          ZdS )    N)Base)expectc                       e Zd Zedd            Zedd            Zedd            Zedd            Zedd            ZdS )	ReduceL2returnNc                  t   g d} t          j        dgt           j                  }d}t          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                            d           t           j                            dd|                               t           j	                  }t          j
        t          j        t          j        |          t          |          |d
k                        }t          |||g|gd           d S )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         `/var/www/html/ai-engine/env/lib/python3.11/site-packages/onnx/backend/test/case/node/reducel2.pyexport_do_not_keepdimszReduceL2.export_do_not_keepdims   s   		x28,,,{$$F#K	 % 
 
 z")Arwu~~'9LLLeTT 'FRYt__5;;QOOO
 
 	$<I9		
 	
 	
 	
 		qy  b%0077
CC'FRYt__5;;QOOO
 
 	$<I8		
 	
 	
 	
 	
 	
    c                  t   g d} t          j        dgt           j                  }d}t          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                            d           t           j                            dd|                               t           j	                  }t          j
        t          j        t          j        |          t          |          |dk    
                    }t          |||g|gd           d S )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:   s   		x28,,,{$$F#K	 % 
 
 z")Arwu~~'9LLLeTT 'FRYt__5;;QOOO
 
 	$<I3		
 	
 	
 	
 		qy  b%0077
CC'FRYt__5;;QOOO
 
 	$<I2		
 	
 	
 	
 	
 	
r7   c                  >   g d} t          j        g t           j                  }d}t          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                            d           t           j                            dd|                               t           j	                  }t          j
        t          j        t          j        |          d |dk    	                    }t          |||g|gd           d S )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_keepdimsg   s~   		x"(+++{$$/)x % 
 
 z")Arwu~~'9LLLeTT '"&29T??TUVVVWW 	$<I?		
 	
 	
 	
 		qy  b%0077
CC'"&29T??TUVVVWW$<I>		
 	
 	
 	
 	
 	
r7   c                  t   g d} t          j        dgt           j                  }d}t          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                            d           t           j                            dd|                               t           j	                  }t          j
        t          j        t          j        |          t          |          |dk    
                    }t          |||g|gd           d S )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   s   		xBH---{$$F#K	 % 
 
 z")Arwu~~'9LLLeTT 'FRYt__5;;QOOO
 
 	$<IA		
 	
 	
 	
 		qy  b%0077
CC'FRYt__5;;QOOO
 
 	$<I@		
 	
 	
 	
 	
 	
r7   c                     g d} d}g d}t           j                            dddgdg|          }t          j        g t          j        	                              |           }t          j        dgt          j        	          }t          j        t          j        |t          j        	                    }t          |||g|gd
           d S )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	 % 
 
 x"*---55e<<x28,,,(28MDDDEE$<I+		
 	
 	
 	
 	
 	
r7   )r   N)	__name__
__module____qualname__staticmethodr6   r;   r?   rD   rJ    r7   r5   r   r      s        *
 *
 *
 \*
X *
 *
 *
 \*
X !
 !
 !
 \!
F *
 *
 *
 \*
X 
 
 
 \
 
 
r7   r   )numpyr    r#   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   rO   r7   r5   <module>rS      s~   
      , , , , , , . . . . . .B
 B
 B
 B
 B
t B
 B
 B
 B
 B
r7   