mindspore.ops.Exp
- class mindspore.ops.Exp[source]
Returns exponential of a tensor element-wise.
\[out_i = e^{x_i}\]- Inputs:
x (Tensor) - The input tensor. \((N,*)\) where \(*\) means, any number of additional dimensions, its rank should less than 8.
- Outputs:
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) >>> exp = ops.Exp() >>> output = exp(x) >>> print(output) [ 2.718282 7.389056 54.598152]