mindspore.ops.exp

mindspore.ops.exp(x)[source]

Returns exponential of a tensor element-wise.

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

x (Tensor) – The input tensor, its rank must be in [0, 7] inclusive.

Returns

Tensor, has the same shape and dtype as the x.

Raises

TypeError – If x is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

>>> x = Tensor(np.array([1.0, 2.0, 4.0]), mindspore.float32)
>>> output = ops.exp(x)
>>> print(output)
[ 2.718282  7.389056 54.598152]