U
    T?h                     @   s8   d dl mZ d dlmZ d dlmZ G dd deZdS )    )Fusion)helper)	OnnxModelc                       s*   e Zd Zed fddZdd Z  ZS )FusionGeluApproximation)modelc                    s   t  |dddgd d S )NFastGeluZGeluZBiasGeluZGeluApproximation)super__init__)selfr   	__class__ d/var/www/html/venv/lib/python3.8/site-packages/onnxruntime/transformers/fusion_gelu_approximation.pyr	      s    z FusionGeluApproximation.__init__c              	   C   sV   t jd|j|j| jd|jd d}d|_| j	| | j
	| | j| j|j< d S )Nr   Z_Approximation)inputsoutputsnamezcom.microsoft)r   Z	make_nodeinputoutputr   Zcreate_node_nameZop_typedomainZnodes_to_removeappendZnodes_to_addZthis_graph_nameZnode_name_to_graph_namer   )r
   nodeZinput_name_to_nodesZoutput_name_to_nodenew_noder   r   r   fuse   s    zFusionGeluApproximation.fuse)__name__
__module____qualname__r   r	   r   __classcell__r   r   r   r   r      s   r   N)Zfusion_baser   Zonnxr   Z
onnx_modelr   r   r   r   r   r   <module>   s   