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

31 lines
702 B
ReStructuredText
Raw Normal View History

2021-12-04 13:55:42 +08:00
mindspore.ops.Log
=================
2021-12-22 11:46:09 +08:00
.. py:class:: mindspore.ops.Log()
2021-12-04 13:55:42 +08:00
2021-12-22 11:46:09 +08:00
逐元素返回Tensor的自然对数。
2021-12-04 13:55:42 +08:00
.. math::
y_i = log_e(x_i)
.. warning::
2021-12-22 11:46:09 +08:00
如果算子Log的输入值在(00.01]或[0.951.05]范围内,则输出精度可能会存在误差。
.. note::
Ascend上输入Tensor的维度要小于等于8CPU上输入Tensor的维度要小于8。
2021-12-04 13:55:42 +08:00
**输入:**
2021-12-22 11:46:09 +08:00
- **x** (Tensor) - 任意维度的输入Tensor。该值必须大于0。
2021-12-04 13:55:42 +08:00
**输出:**
Tensor具有与 `x` 相同的shape。
**异常:**
2022-01-20 16:02:51 +08:00
**TypeError** - `x` 不是Tensor。
**TypeError** - `x` 的数据类型不是float16、float32或float64。
2021-12-04 13:55:42 +08:00