mindspore.ops.exp
- mindspore.ops.exp(input)[source]
Returns exponential of a tensor element-wise.
\[out_i = e^{x_i}\]- Parameters
input (Tensor) – The input tensor.
- Returns
Tensor, has the same shape and dtype as the input.
- Raises
TypeError – If input is not a Tensor.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor, ops >>> x = Tensor(np.array([1.0, 2.0, 4.0]), mindspore.float32) >>> output = ops.exp(x) >>> print(output) [ 2.718282 7.389056 54.598152]