mindspore.ops.FastGeLU

class mindspore.ops.FastGeLU[source]

Fast Gaussian Error Linear Units activation function.

Refer to mindspore.ops.fast_gelu() for more details.

Inputs:
  • x (Tensor) - Input to compute the FastGeLU with data type of float16 or float32.

Outputs:

Tensor, with the same type and shape as x.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> x = Tensor(np.array([[-1.0, 4.0, -8.0], [2.0, -5.0, 9.0]]), mindspore.float32)
>>> fast_gelu = ops.FastGeLU()
>>> output = fast_gelu(x)
>>> print(output)
[[-1.5418735e-01  3.9921875e+00 -9.7473649e-06]
 [ 1.9375000e+00 -1.0052517e-03  8.9824219e+00]]