
    /jq                    \    d dl mZ d dlZd dlZd dlmZ d dlmZ d Z	 G d de          Z
dS )    )annotationsN)Base)expectc                    t          j        | t           j                  t          j        |t           j                  t          j        |t           j                  fS )Ndtype)nparrayint64)indicesinverse_indicescountss      g/home/longshao/multi-rider-rag/.venv/lib/python3.11/site-packages/onnx/backend/test/case/node/unique.pyspecify_int64r      sH    
)))
111
rx(((     c                      e Zd Zed
d            Zed
d            Zed
d            Zed
d            Zed
d            Zed
d            Z	d	S )UniquereturnNonec                 &   t           j                            ddgg d          } t          j        g dt          j                  }t          j        |ddd          \  }}}}t          |||          \  }}}t          | |g||||gd	           d S )
Nr   XYr   r   r   )inputsoutputs       @      ?r         @g      @r   r   Ttest_unique_sorted_without_axisr   r   name)	onnxhelper	make_noder	   r
   float32uniquer   r   node_sortedxyr   r   r   s         r   export_sorted_without_axisz!Unique.export_sorted_without_axis   s    k++5AAA , 
 
 H3332:FFF.0i4t.L.L+7OV+8_f,
 ,
(& 	3&92		
 	
 	
 	
 	
 	
r   c            
     t   t           j                            ddgg dd          } t          j        g dt          j                  }t          j        |ddd          \  }}}}t          j        |          }t          t          |t          j
        t          |                    d	                    ||         }t          j        ||d
          }t          j        fd|D             t          j                  }||         }t          |||          \  }}}t!          | |g||||gd           d S )Nr   r   r   r   r   r   sortedr   r   T)strictaxisc                     g | ]
}|         S  r4   ).0iinverse_indices_maps     r   
<listcomp>z9Unique.export_not_sorted_without_axis.<locals>.<listcomp>A   s    === #===r   #test_unique_not_sorted_without_axisr!   )r#   r$   r%   r	   r
   r&   r'   argsortdictziparangelentakeasarrayr   r   r   )node_not_sortedr*   r+   r   r   r   argsorted_indicesr7   s          @r   export_not_sorted_without_axisz%Unique.export_not_sorted_without_axis*   sp   +//5AAA	 0 
 
 H3332:FFF.0i4t.L.L+7OV Jw//"!29S1B-C-C#D#DTRRR
 
 +,GAwQ'''*====_===RX
 
 
 )*+8_f,
 ,
(& 	3&96		
 	
 	
 	
 	
 	
r   c                 f   t           j                            ddgg ddd          } t          j        g dg dg dgt          j        	          }t          j        |d
d
d
d          \  }}}}t          |||          \  }}}|                    d          }t          | |g||||gd           d S )Nr   r   r      r   r   r   r/   r2   rE   r   r   )         r   Tr1   test_unique_sorted_with_axisr!   
r#   r$   r%   r	   r
   r&   r'   r   reshaper   r(   s         r   export_sorted_with_axiszUnique.export_sorted_with_axisW   s    k++5AAA , 
 
 HiiiIII6bjIII.0i4tRS.T.T.T+7OV+8_f,
 ,
(& *11"55 	3&9/		
 	
 	
 	
 	
 	
r   c                    t           j                            ddgg ddd          } t          j        ddgddgddgddggddgddgddgddgggt          j        	          }t          j        |d
d
d
d          \  }}}}t          |||          \  }}}|                    d          }t          | |g||||gd           d S )Nr   r   r   rE   rF   r   g        r   r   Tr1   rK   test_unique_sorted_with_axis_3dr!   rM   r(   s         r   export_sorted_with_axis_3dz!Unique.export_sorted_with_axis_3dy   s#   k++5AAA , 
 
 Hsc3Z#sc3Z@sc3Z#sc3Z@ *
 
 
 /1i4tRS.T.T.T+7OV+8_f,
 ,
(& *11"55 	3&92		
 	
 	
 	
 	
 	
r   c                 f   t           j                            ddgg ddd          } t          j        g dg dg dgt          j        	          }t          j        |d
d
d
d          \  }}}}t          |||          \  }}}|                    d          }t          | |g||||gd           d S )Nr   r   r   rE   rK   rF   rG   )rH   rI   rI   r   Tr1   %test_unique_sorted_with_negative_axisr!   rM   r(   s         r    export_sorted_with_negative_axisz'Unique.export_sorted_with_negative_axis   s    k++5AAA , 
 
 HiiiIII6bjIII.0i4tRT.U.U.U+7OV+8_f,
 ,
(& *11"55 	3&98		
 	
 	
 	
 	
 	
r   c                 P   t           j                            ddgg dd          } t          j        dgt          j                  }t          j        |ddd          \  }}}}t          |||          \  }}}|                    d	          }t          | |g||||gd
           d S )Nr   r   r   rE   r.   r   r   TrK   test_unique_length_1r!   )
r#   r$   r%   r	   r
   r   r'   r   rN   r   r(   s         r   export_length_1zUnique.export_length_1   s    k++5AAA	 , 
 
 HaS))).0i4t.L.L+7OV+8_f,
 ,
(& *11"55 	3&9'		
 	
 	
 	
 	
 	
r   N)r   r   )
__name__
__module____qualname__staticmethodr,   rC   rO   rR   rU   rX   r4   r   r   r   r      s        
 
 
 \
& *
 *
 *
 \*
X 
 
 
 \
B (
 (
 (
 \(
T  
  
  
 \ 
D 
 
 
 \
 
 
r   r   )
__future__r   numpyr	   r#   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   r   r4   r   r   <module>ra      s    # " " " " "      , , , , , , . . . . . .  P
 P
 P
 P
 P
T P
 P
 P
 P
 P
r   