mindspore.numpy.log1p
- mindspore.numpy.log1p(x, dtype=None)[源代码]
- 返回1加上输入数组的自然对数,逐元素计算。 - 计算 - log(1 + x)。- 说明 - 不支持NumPy参数 out 、 where 、 casting 、 order 、 subok 、 signature 、 extobj 。 - 参数:
- x (Tensor) - 输入数组。 
- dtype (mindspore.dtype) - 默认值: None 。覆盖输出Tensor的dtype。 
 
- 返回:
- Tensor或标量。如果 x 是标量,返回标量。 
- 支持平台:
- 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 ]