mindspore.mint.log10

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

Returns the logarithm to the base 10 of a tensor element-wise.

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

Warning

  • This is an experimental API that is subject to change or deletion.

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

Parameters

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

Returns

Tensor, has the same shape as the input, and the dtype changes according to the input.dtype.

  • if input.dtype is in [float16, float32, float64, bfloat16], the output dtype is the same as the input.dtype.

  • if input.dtype is integer or boolean type, the output dtype is float32.

Raises

TypeError – If input is not a Tensor.

Supported Platforms:

Ascend

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, mint
>>> x = Tensor(np.array([3.0, 5.0, 7.0]), mindspore.float32)
>>> output = mint.log10(x)
>>> print(output)
[0.47712136 0.69897    0.845098  ]