mindspore.numpy.log1p

mindspore.numpy.log1p(x, dtype=None)[source]

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

Calculates log(1 + x).

Note

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

Parameters
  • x (Tensor) – Input array.

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

Returns

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

Supported Platforms:

Ascend GPU CPU

Examples

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