mindspore/docs/api/api_python/ops/mindspore.ops.func_log2.rst

26 lines
823 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.log2
===================
.. py:function:: mindspore.ops.log2(x)
逐元素返回Tensor以2为底的对数。
.. math::
y_i = log_{2}(x_i)
.. warning::
如果log2的输入值范围在(0, 0.01]或[0.95, 1.05]区间,输出精度可能会受影响。
.. note::
Ascend上输入Tensor的维度要小于等于8CPU或GPU上输入Tensor的维度要小于8。
参数:
- **x** (Tensor) - 任意维度的输入Tensor。该值必须大于0。
返回:
Tensor具有与 `x` 相同的shape。
异常:
- **TypeError** - `x` 不是Tensor。
- **TypeError** - 在GPU和CPU平台上运行时`x` 的数据类型不是float16、float32或float64。在Ascend平台上运行时`x` 的数据类型不是float16或float32。