mindspore.ops.log10

View Source On Gitee
mindspore.ops.log10(input)[source]

Returns a new Tensor by taking the base 10 logarithm of the elements in the input Tensor.

\[y_i = \log_{10}(input_i)\]

Warning

If the input value of operator log10 is within the range (0, 0.01] or [0.95, 1.05], the output accuracy may be affected.

Parameters

input (Tensor) – Input Tensor of any dimension. The each element in Tensor must be greater than 0.

Returns

Tensor, has the same shape and dtype as the input.

Raises
  • TypeError – If input is not a Tensor.

  • TypeError – If dtype of input is not float16 or float32 or float64 on CPU and GPU, if dtype of input is not float16 or float32 on Ascend.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> x = Tensor(np.array([2, 4, 10]).astype(np.float16))
>>> output = ops.log10(x)
>>> print(output)
[0.301 0.602 1.   ]