Applies the Gaussian Error Linear Units function: $$\mbox{GELU}(x) = x * \Phi(x)$$
Shape
Input: \((N, *)\) where
*
means, any number of additional dimensionsOutput: \((N, *)\), same shape as the input
Examples
if (torch_is_installed()) {
m <- nn_gelu()
input <- torch_randn(2)
output <- m(input)
}