mindspore.ops.Expm1

class mindspore.ops.Expm1(*args, **kwargs)[source]

Returns exponential then minus 1 of a tensor element-wise.

\[out_i = e^{x_i} - 1\]
Inputs:
  • input_x (Tensor) - The input tensor. With float16 or float32 data type.

Outputs:

Tensor, has the same shape as the input_x.

Raises

TypeError – If dtype of input_x is neither float16 nor float32.

Supported Platforms:

Ascend GPU CPU

Examples

>>> input_x = Tensor(np.array([0.0, 1.0, 2.0, 4.0]), mindspore.float32)
>>> expm1 = ops.Expm1()
>>> output = expm1(input_x)
>>> print(output)
[ 0.        1.718282  6.389056 53.598152]