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

21 lines
658 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.mint.log2
===================
.. py:function:: mindspore.mint.log2(input)
逐元素返回Tensor以2为底的对数。
.. math::
y_i = \log_2(x_i)
.. warning::
- 如果输入值在(0, 0.01]或[0.95, 1.05]范围内,则输出精度可能会存在误差。
参数:
- **input** (Tensor) - 任意维度的输入Tensor。其值必须大于0。
返回:
Tensor具有与 `input` 相同的shape。如果 `input.dtype` 为整数或布尔类型输出数据类型为float32。否则输出数据类型与 `input.dtype` 相同。
异常:
- **TypeError** - `input` 不是Tensor。