o
    Me  ã                   @   sR   d dl mZ d dlmZmZ ddlmZmZ e			ddd„ƒZedd	d
„ƒZ	dS )é   )Úcore)Údygraph_onlyÚin_dygraph_modeé    )Ú_C_opsÚ_legacy_C_opsNc                 C   sF   |du r| S d}|rd|f}|r|d|f7 }t t|ƒ}|| g|¢R Ž S )zúAppend activation in dygraph mode.

        Args:
            input: the input variable. 
            act: activation type
            use_mkldnn: if use mkldnn
            use_cudnn: if use cudnn

    Return the Variable after append activation
    N© Ú	use_cudnnÚ
use_mkldnn)Úgetattrr   )ÚinputZactr	   r
   ÚattrsZact_opr   r   úJD:\Projects\ConvertPro\env\Lib\site-packages\paddle/fluid/dygraph_utils.pyÚ_append_activation_in_dygraph   s   
r   Fc                 C   s    |du r| S t  | |d|d|¡S )a  Append bias operation in dygraph mode.

        Args:
            input: the input variable. 
            bias:  the bias to be appended
            axis:  the axis to perform operation
            use_mkldnn: whether to use mkldnn

    Return the Variable after bias operation
    NÚaxisr
   )r   Zelementwise_add)r   Zbiasr   r
   r   r   r   Ú_append_bias_in_dygraph0   s
   ÿr   )NNN)Nr   F)
Ú r   Z	frameworkr   r   Zpaddler   r   r   r   r   r   r   r   Ú<module>   s   ý