
    bIg                    @    d dl mZ d dlZd dlmZ d Z G d de      Zy)    )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      Y/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/reference/ops/op_unique.py_specify_int64r      sB    
)
1
rxx(     c                      e Zd ZddZy)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        |                        }	||   }t        j                  ||d      }t        j                  |D 
cg c]  }
|	|
   	 c}
t         j                        }||   }t        |||      \  }}}|j                         }t        | j                  j
                        dk(  r||fS t        | j                  j
                        dk(  r|||fS ||||fS c c}
w )NT)axis   r   r         )r   isnanuniquelen	onnx_nodeoutputargsortdictziparangetakeasarrayr
   r   squeeze)selfxr   sortedyr   r   r   argsorted_indicesinverse_indices_mapis              r   _runzUnique._run   s}   <288D>24))AtT42P/Aw24))4t$3/Aw t~~$$%*4K "

7 3"&%ryy5F1G'HI# /0G7+A jj1@AA$Q'AO -.F+9_f,
(& *113t~~$$%*w<t~~$$%*w007OV44 Bs   2F)NN)__name__
__module____qualname__r+    r   r   r   r      s    5r   r   )
__future__r   numpyr   onnx.reference.op_runr   r   r   r/   r   r   <module>r3      s!    #  ' 5U  5r   