You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.Log.rst 860 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. mindspore.ops.Log
  2. =================
  3. .. py:class:: mindspore.ops.Log(*args, **kwargs)
  4. 按元素返回Tensor的自然对数。
  5. .. math::
  6. y_i = log_e(x_i)
  7. .. warning::
  8. 如果算子Log的输入值在(0,0.01]或[0.95,1.05]范围内,则输出精度可能会发生变化。
  9. **输入:**
  10. - **x** (Tensor) - 输入Tensor。该值必须大于0。shape为 :math:`(N,*)`,其中 :math:`*` 表示任意的附加维度数,它的秩应小于8。
  11. **输出:**
  12. Tensor,具有与 `x` 相同的shape。
  13. **异常:**
  14. - **TypeError** - `x` 不是Tensor。
  15. **支持平台:**
  16. ``Ascend`` ``GPU`` ``CPU``
  17. **样例:**
  18. >>> x = Tensor(np.array([1.0, 2.0, 4.0]), mindspore.float32)
  19. >>> log = ops.Log()
  20. >>> output = log(x)
  21. >>> print(output)
  22. [0. 0.6931472 1.3862944]