mindspore.ops.Log
- class mindspore.ops.Log[source]
 Returns the natural logarithm of a tensor element-wise.
\[y_i = log_e(x_i)\]Warning
If the input value of operator Log is within the range (0, 0.01] or [0.95, 1.05], the output accuracy is subject to change.
- Inputs:
 x (Tensor) - The input tensor. The data type must be float16, float32 or float64. The value must be greater than 0. \((N,*)\) where \(*\) means, any number of additional dimensions, its rank should be less than 8.
- Outputs:
 Tensor, has the same shape and dtype as the x.
- Raises
 
- Supported Platforms:
 AscendGPUCPU
Examples
>>> x = Tensor(np.array([1.0, 2.0, 4.0]), mindspore.float32) >>> log = ops.Log() >>> output = log(x) >>> print(output) [0. 0.6931472 1.3862944]