U
    qh                      @  s0   d dl mZ d dlZdd Zdd Zdd ZdS )	    )annotationsNc                 C  sh   t jt|ft jd}t|d }|dkr\| ||  }|||< | |8 } | ||  } |d8 }q"| |d< |S )N)Zdtype   r   )npemptylenZint64)ishapereskm r   I/tmp/pip-unpacked-wheel-xnis5xre/onnx/reference/ops/_op_common_indices.py_get_indices	   s    
r   c                 C  s4   t | |D ]$\}}|dk r  dS ||kr
 dS q
dS )Nr   TF)zip)indr   r   sr   r   r   _is_out   s    r   c                 C  s<   d}d}t t| t|D ]\}}||| 7 }||9 }q|S )Nr   r   )r   reversed)indicesr   r   mulposshr   r   r   
_get_index   s    
r   )
__future__r   Znumpyr   r   r   r   r   r   r   r   <module>   s   	