o
    wi                     @  sH   d dl mZ d dlZd dlZd dlmZ d dlmZ G dd deZ	dS )    )annotationsN)Base)expectc                   @  s6   e Zd Zed
ddZed
ddZed
ddZd	S )ClipreturnNonec                  C  s  t jjdg ddgd} tg dtj}td}td}t|||}t| |||g|gdd	 tj	
d
ddtj}t|||}t| |||g|gdd	 t jjdg ddgd} td}td}tg dtj}tg dtj}t| |||g|gdd	 tg dtj}tg dtj}t| |||g|gdd	 tg dtj}tg dtj}t| |||g|gdd	 tg dtj}tg dtj}td}td}t| |||g|gdd	 d S )Nr   )xminmaxyinputsoutputs)r         test_clip_exampler   r   name         	test_clipr   r   r   test_clip_inbounds)ir      )r   r   r   test_clip_outbounds)r   r   r   )r   r   r   test_clip_splitbounds)r   r   r   )r   r   r   r   test_clip_min_greater_than_max)onnxhelper	make_nodenparrayastypefloat32clipr   randomrandn)noder   min_valmax_valr    r.   ]/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/onnx/backend/test/case/node/clip.pyexport   sd   






zClip.exportc                  C  s*  t jjdddgdgd} td}tjddd	tj}t||tj	}t
| ||g|gd
d d}t jjdd|dgdgd} td}tjddd	tj}t|tj	 |}t
| ||g|gdd d}t jjdd||gdgd} tg dtj}tg dtj}t
| |g|gdd d S )Nr   r   r	   r   r   r   r   r   r   test_clip_default_minr    r
   test_clip_default_maxr   test_clip_default_inbounds)r!   r"   r#   r$   r'   r)   r*   r&   r(   infr   r%   r+   r,   r   r   no_minr-   no_maxr.   r.   r/   export_clip_defaultJ   s8   

zClip.export_clip_defaultc                  C  s8  t jjdddgdgd} td}tjddd	tj}t||t	tjj
}t| ||g|gd
d d}t jjdd|dgdgd} td}tjddd	tj}t|t	tjj|}t| ||g|gdd d}t jjdd||gdgd} tg dtj}tg dtj}t| |g|gdd d S )Nr   r   r	   r   r   r   r   r   r   test_clip_default_int8_minr   r2   r
   test_clip_default_int8_maxr   test_clip_default_int8_inbounds)r!   r"   r#   r$   int8r)   r*   r&   r(   iinfor
   r   r	   r%   r6   r.   r.   r/   export_clip_default_int8l   s@   

zClip.export_clip_default_int8N)r   r   )__name__
__module____qualname__staticmethodr0   r9   r?   r.   r.   r.   r/   r      s    ;!r   )

__future__r   numpyr$   r!   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   r.   r.   r.   r/   <module>   s   