mindspore.numpy.log1p

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

Returns the natural logarithm of one plus the input array, element-wise.

Calculates log(1 + x).

说明

Numpy arguments out, where, casting, order, subok, signature, and extobj are not supported.

参数
  • x (Tensor) – Input array.

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

返回

Tensor or scalar. This is a scalar if x is a scalar.

Supported Platforms:

Ascend GPU CPU

样例

>>> import mindspore.numpy as np
>>> x = np.array([1, 2, 3]).astype('float16')
>>> output = np.log1p(x)
>>> print(output)
[0.6934 1.099 1.387 ]