mindspore.ops.Log1p

class mindspore.ops.Log1p[source]

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

Refer to mindspore.ops.log1p() for more details.

Inputs:
  • x (Tensor) - The input tensor. The value must be greater than -1. With float16 or float32 data type.

Outputs:

Tensor, has the same shape as the x.

Supported Platforms:

Ascend GPU CPU

Examples

>>> x = Tensor(np.array([1.0, 2.0, 4.0]), mindspore.float32)
>>> log1p = ops.Log1p()
>>> output = log1p(x)
>>> print(output)
[0.6931472 1.0986123 1.609438 ]