
    /j|                    V    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	dS )    )annotationsN)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returnNonec                 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         i/home/longshao/multi-rider-rag/.venv/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!   r4   s         r7   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		
 	
 	
 	
 	
 	
r9   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   r0   r1   r2   r3   r4   s         r7   export_default_axes_keepdimsz%ReduceL2.export_default_axes_keepdimsh   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>		
 	
 	
 	
 	
 	
r9   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!   r4   s         r7   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@		
 	
 	
 	
 	
 	
r9   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   rH   r   r   r   r   r   r   test_reduce_l2_empty_setr   )
r%   r&   r'   r"   r#   r+   r(   r$   zerosr   )r5   r   reduced_shaper6   r   r   r   s          r7   export_empty_setzReduceL2.export_empty_set   s    		!		{$$F#K	 % 
 
 x"*---55e<<x28,,,(28MDDDEE$<I+		
 	
 	
 	
 	
 	
r9   N)r   r	   )	__name__
__module____qualname__staticmethodr8   r=   rA   rF   rL    r9   r7   r   r      s        *
 *
 *
 \*
X *
 *
 *
 \*
X !
 !
 !
 \!
F *
 *
 *
 \*
X 
 
 
 \
 
 
r9   r   )

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