mindspore.Tensor.exp
- Tensor.exp() Tensor
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
GPU
CPU
Examples
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor >>> input = Tensor(np.array([0.0, 1.0, 3.0]), mindspore.float32) >>> output = Tensor.exp(input) >>> print(output) [ 1. 2.7182817 20.085537]