
    bIg                    V    d dl mZ d dl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                  0    e Zd Zedd       Zedd       Zy)Geluc                 f   t         j                  j                  ddgdgd      } t        j                  g d      j                  t        j                        }d|z  dt        j                  t        j                  d	t        j                  z        |d
t        j                  |d      z  z   z        z   z  j                  t        j                        }t        | |g|gd       t        j                  j                  ddd      j                  t        j                        }d|z  dt        j                  t        j                  d	t        j                  z        |d
t        j                  |d      z  z   z        z   z  j                  t        j                        }t        | |g|gd       y )Nr   xytanh)inputsoutputsapproximater            ?r      gHm?   test_gelu_tanh_1r   r   name      test_gelu_tanh_2)onnxhelper	make_nodenparrayastypefloat32r   sqrtpipowerr   randomrandnnoder	   r
   s      ]/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/backend/test/case/node/gelu.pyexport_gelu_tanhzGelu.export_gelu_tanh   s\   {{$$C53%V % 
 HHZ ''

3 2772771ruu9-XA5N1NOPPR &
	 	

 	tQC!3EFIIOOAq!$++BJJ7 2772771ruu9-XA5N1NOPPR &
	 	

 	tQC!3EF    c                    t         j                  j                  ddgdg      } t        j                  g d      j                  t        j                        }d|z  d t        j                  t        j                        |t        j                  d      z        z   z  j                  t        j                        }t        | |g|gd	
       t        j                  j                  ddd      j                  t        j                        }d|z  d t        j                  t        j                        |t        j                  d      z        z   z  j                  t        j                        }t        | |g|gd
       y )Nr   r	   r
   )r   r   r   r   r   r   test_gelu_default_1r   r   r   r   test_gelu_default_2)r   r   r   r   r   r    r!   	vectorizematherfr"   r   r%   r&   r'   s      r)   export_gelu_defaultzGelu.export_gelu_default(   s   {{$$VSEC5$IHHZ ''

31W2BLL21rwwqz>BBCKKBJJWtQC!3HIIIOOAq!$++BJJ71W2BLL21rwwqz>BBCKKBJJWtQC!3HIr+   N)returnNone)__name__
__module____qualname__staticmethodr*   r2    r+   r)   r   r      s,    G G. J Jr+   r   )
__future__r   r0   numpyr   r   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   r9   r+   r)   <module>r>      s'    #    , .%J4 %Jr+   