mindspore.Tensor.expm1

Tensor.expm1() Tensor

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

\[out_i = e^{x_i} - 1\]

Note

The input Tensor. \(x\) in the above formula.

Returns

Tensor, has the same shape as the self.

Raises

TypeError – If self is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor
>>> x = Tensor(np.array([0.0, 1.0, 2.0, 4.0]), mindspore.float32)
>>> output = x.expm1()
>>> print(output)
[ 0.        1.718282  6.389056 53.598152]