o
    wÖi–  ã                   @  sb   d dl mZ d dlZd dlmZ 	 ddd
d„ZG dd„ deƒZG dd„ deƒZG dd„ deƒZ	dS )é    )ÚannotationsN)ÚOpRunÚdataú
np.ndarrayÚshapeÚ	allowzeroÚintÚreturnc                 C  sD   t  |¡}|dkrt  |dk¡}t  | j¡| ||< t  | |¡}|S ©Nr   )ÚnpÚcopyÚwhereÚarrayr   Úreshape)r   r   r   Ú	new_shapeÚzeros_indexÚreshaped© r   úZ/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/onnx/reference/ops/op_reshape.pyÚ reshape_reference_implementation   s   
r   c                   @  s   e Zd Zdd„ ZdS )ÚCommonReshapec                 C  s   t ||dƒfS r
   )r   )Úselfr   r   r   r   r   Ú_run   s   zCommonReshape._runN©Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s    r   c                   @  s   e Zd ZdS )Ú	Reshape_5N)r   r   r   r   r   r   r   r      s    r   c                   @  s   e Zd Zddd„ZdS )Ú
Reshape_14Nc                 C  s0   |d u rt | ddƒdk}n|dk}t|||ƒfS )Nr   r   é   )Úgetattrr   )r   r   r   r   r   r   r   r   "   s   zReshape_14._run)Nr   r   r   r   r   r   !   s    r   )r   )r   r   r   r   r   r   r	   r   )
Ú
__future__r   Únumpyr   Úonnx.reference.op_runr   r   r   r   r   r   r   r   r   Ú<module>   s   ÿ