o
    ;ήc                     @   sD   d dl mZ d dlmZ d dlmZ d dlmZ G dd deZdS )    )	getLogger)Fusion)helper)	OnnxModelc                       s*   e Zd Zdef fddZdd Z  ZS )FusionGeluApproximationmodelc                    s   t  |dddgd d S )NFastGeluGeluBiasGeluGeluApproximation)super__init__)selfr   	__class__ Y/tmp/pip-target-vg8gfxp4/lib/python/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   _Approximation)inputsoutputsnamezcom.microsoft)r   	make_nodeinputoutputr   create_node_nameop_typedomainnodes_to_removeappendnodes_to_addthis_graph_namenode_name_to_graph_namer   )r   nodeinput_name_to_nodes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)	loggingr   fusion_baser   onnxr   
onnx_modelr   r   r   r   r   r   <module>   s
   