
    wi                    H    d dl mZ d dlZd dlmZ d Z G d de          ZdS )    )annotationsN)OpRunc                    t          j        | t           j                  t          j        |t           j                  t          j        |t           j                  fS )Ndtype)nparrayint64)indicesinverse_indicescountss      l/root/.openclaw/workspace/chatterbox_venv_py311/lib/python3.11/site-packages/onnx/reference/ops/op_unique.py_specify_int64r      sH    
)))
111
rx(((     c                      e Zd ZddZdS )UniqueNc           
       	 |t          j        |          rt          j        |ddd          \  }}}}nt          j        |ddd|          \  }}}}t          | j        j                  dk    r|fS |st          j        |          }t          t          |t          j	        t          |                    d                    	||         }t          j
        ||d          }t          j        	fd|D             t           j                  }||         }t          |||          \  }}}|                    d          }t          | j        j                  d	k    r||fS t          | j        j                  d
k    r|||fS ||||fS )NT)axis   )strictr   c                     g | ]
}|         S  r   ).0iinverse_indices_maps     r   
<listcomp>zUnique._run.<locals>.<listcomp>&   s    AAAA$Q'AAAr   r         )r   isnanuniquelen	onnx_nodeoutputargsortdictziparangetakeasarrayr
   r   reshape)
selfxr   sortedyr   r   r   argsorted_indicesr   s
            @r   _runzUnique._run   s   <28D>><24)AtT42P2P/Aw24)4t$3 3 3/Aw t~$%%**4K 
	/ "
7 3 3"&%ry5F1G1G'H'HQUVVV# # /0G7+++A jAAAAAAA  O -.F+9_f,
 ,
(& *11"55t~$%%**w<t~$%%**w007OV44r   )NN)__name__
__module____qualname__r1   r   r   r   r   r      s(        5 5 5 5 5 5r   r   )
__future__r   numpyr   onnx.reference.op_runr   r   r   r   r   r   <module>r8      sz    # " " " " "     ' ' ' ' ' '   5  5  5  5  5U  5  5  5  5  5r   