mindspore.mint.exp

View Source On Gitee
mindspore.mint.exp(input)[source]

Returns exponential of a tensor element-wise.

\[out_i = e^{x_i}\]
Parameters

input (Tensor) – The input tensor. \(x\) in the following formula.

Returns

Tensor, has the same shape as the input.

Raises

TypeError – If input is not a Tensor.

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, mint
>>> input = Tensor(np.array([0.0, 1.0, 3.0]), mindspore.float32)
>>> output = mint.exp(input)
>>> print(output)
[ 1.        2.7182817 20.085537]