8272cef2585f113af24dc45f3b1243a9622f1bec,src/gluonnlp/model/block.py,GELU,hybrid_forward,#GELU#Any#Any#,110

Before Change


            - **out**: output tensor with the same shape as `data`.
        
        if not self._approximate:
            return x * 0.5 * (1.0 + F.erf(x / math.sqrt(2.0)))
        else:
            return 0.5 * x * (1 + F.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * (x ** 3))))

    def __repr__(self):

After Change


            - **out**: output tensor with the same shape as `data`.
        
        if not self._approximate:
            return F.LeakyReLU(x, act_type="gelu")
        else:
            return 0.5 * x * (1 + F.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * (x ** 3))))

    def __repr__(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: dmlc/gluon-nlp
Commit Name: 8272cef2585f113af24dc45f3b1243a9622f1bec
Time: 2020-01-03
Author: tao.a.lv@intel.com
File Name: src/gluonnlp/model/block.py
Class Name: GELU
Method Name: hybrid_forward


Project Name: dmlc/gluon-nlp
Commit Name: 20af58f254e0eb72d7938de063ff0909139b4ba7
Time: 2020-08-05
Author: 37728728+ZheyuYe@users.noreply.github.com
File Name: src/gluonnlp/layers.py
Class Name: GELU
Method Name: hybrid_forward


Project Name: dmlc/gluon-nlp
Commit Name: 3c874575bf40e8b1fa2280371131a8f29ebb3e98
Time: 2020-07-28
Author: xshiab@connect.ust.hk
File Name: src/gluonnlp/layers.py
Class Name: GELU
Method Name: hybrid_forward