mindspore.numpy.expm1
- mindspore.numpy.expm1(x, dtype=None)[source]
Calculates
exp(x) - 1
for all elements in the array.Note
Numpy arguments out, where, casting, order, subok, signature, and extobj are not supported. On GPU, the supported dtypes are np.float16, and np.float32. On CPU, the supported dtypes are np.float16, and np.float32.
- Parameters
x (Tensor) – input data.
dtype (
mindspore.dtype
, optional) – defaults to None. Overrides the dtype of the output Tensor.
- Returns
Tensor or scalar, element-wise exponential minus one,
out = exp(x) - 1
. This is a scalar if both x1 and x2 are scalars.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore.numpy as np >>> output = np.expm1(np.arange(5).astype(np.float32)) >>> print(output) [ 0. 1.7182819 6.389056 19.085537 53.59815 ]