Skip to content
fn

gelu_op

→TensorImplPtr
int gelu_op(const int & a)

Python wrappers

Public Python APIs implemented by this engine symbol.

Tanh-approximation GeLU y=0.5 x (1+tanh⁡(2/π (x+0.044715 x3)))y = 0.5\,x\,(1 + \tanh(\sqrt{2/\pi}\,(x + 0.044715\,x^3))).

See Also

gelu_exact_op : Exact erf-based variant. GeluBackward : Autograd node implementing the gradient rule.

Parameters

aTensorImplPtr
Input tensor.

Returns

TensorImplPtr

Output tensor with the same shape as a.