
    bIg                    N    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e      Z	y)    )annotationsN)Base)expectc                  B    e Zd Zedd       Zedd       Zedd       Zy)Clipc                    t         j                  j                  dg ddg      } t        j                  g d      j                  t        j                        }t        j                  d      }t        j                  d      }t        j                  |||      }t        | |||g|gd	       t        j                  j                  d
dd      j                  t        j                        }t        j                  |||      }t        | |||g|gd	       t         j                  j                  dg ddg      } t        j                  d      }t        j                  d      }t        j                  g d      j                  t        j                        }t        j                  g d      j                  t        j                        }t        | |||g|gd	       t        j                  g d      j                  t        j                        }t        j                  g d      j                  t        j                        }t        | |||g|gd	       t        j                  g d      j                  t        j                        }t        j                  g d      j                  t        j                        }t        | |||g|gd	       y )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)onnxhelper	make_nodenparrayastypefloat32clipr   randomrandn)noder	   min_valmax_valr   s        ]/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/backend/test/case/node/clip.pyexportzClip.export   s!   {{$$&E % 
 HHZ ''

3**R.**Q-GGAw(!Wg.BU	
 IIOOAq!$++BJJ7GGAw(tQ1A3[Q{{$$&E % 
 **R.**Q-HHZ ''

3HHZ ''

3!Wg.BV	
 HHZ ''

3HHZ ''

3!Wg.BW	
 HHZ ''

3HHZ ''

3w(C(		
    c                 
   t         j                  j                  dddgdg      } t        j                  d      }t        j
                  j                  ddd	      j                  t        j                        }t        j                  ||t        j                        }t        | ||g|gd
       d}t         j                  j                  dd|dgdg      } t        j                  d      }t        j
                  j                  ddd	      j                  t        j                        }t        j                  |t        j                   |      }t        | ||g|gd       d}t         j                  j                  dd||gdg      } t        j                  g d      j                  t        j                        }t        j                  g d      j                  t        j                        }t        | |g|gd       y )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_maxs          r.   export_clip_defaultzClip.export_clip_default?   s   {{$$<E % 

 **Q-IIOOAq!$++BJJ7GGAw'tQL1#<ST{{$$'E % 

 **Q-IIOOAq!$++BJJ7GGAw(tQL1#<ST{{$$(E % 
 HHZ ''

3HHZ ''

3tQC!3OPr0   c                 |   t         j                  j                  dddgdg      } t        j                  d      }t        j
                  j                  ddd	      j                  t        j                        }t        j                  ||t        j                  t        j                        j                        }t        | ||g|gd
       d}t         j                  j                  dd|dgdg      } t        j                  d      }t        j
                  j                  ddd	      j                  t        j                        }t        j                  |t        j                  t        j                        j                  |      }t        | ||g|gd       d}t         j                  j                  dd||gdg      } t        j                  g d      j                  t        j                        }t        j                  g d      j                  t        j                        }t        | |g|gd       y )Nr   r	   r
   r   r   r   r   r   r   test_clip_default_int8_minr   r3   r   test_clip_default_int8_maxr   test_clip_default_int8_inbounds)r!   r"   r#   r$   int8r)   r*   r&   r(   iinfor   r   r
   r%   r7   s          r.   export_clip_default_int8zClip.export_clip_default_int8a   s   {{$$<E % 

 ''!*IIOOAq!$++BGG4GGAw 1 5 56!Ws9U	
 {{$$'E % 

 ''!*IIOOAq!$++BGG4GGArxx(,,g6!Ws9U	
 {{$$(E % 
 HHZ ''0HHZ ''0tQC!3TUr0   N)returnNone)__name__
__module____qualname__staticmethodr/   r:   rA    r0   r.   r   r      sB    .
 .
` Q QB #V #Vr0   r   )

__future__r   numpyr$   r!   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   rH   r0   r.   <module>rM      s&    #   , .xV4 xVr0   