mindspore.numpy.expm1

mindspore.numpy.expm1(x, dtype=None)[源代码]

Calculates exp(x) - 1 for all elements in the array.

说明

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.

参数
  • x (Tensor) – input data.

  • dtype (mindspore.dtype, optional) – Default: None . Overrides the dtype of the output Tensor.

返回

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

样例

>>> 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  ]