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

27 lines
832 B
ReStructuredText
Raw 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.ldexp
====================
.. py:function:: mindspore.ops.ldexp(x, other)
逐元素将输入Tensor乘以 :math:`2^{other}`
该函数使用两个参数,即尾数 `x` 和指数 `other` ,并将它们的乘积作为浮点数返回:
.. math::
out_{i} = x_{i} * ( 2_{i} ^{other} )
.. note::
该函数通常用于由尾数和幂构造浮点数,或将浮点数按二的幂进行缩放。
参数:
- **x** (Tensor) - 输入的一个Tensor。
- **other** (Tensor) - 指数Tensor通常为整数。
返回:
Tensor返回计算的结果。
异常:
- **TypeError** - 如果 `x` 不是Tensor。
- **TypeError** - 如果 `other` 不是Tensor。
- **ValueError** - 如果 `x``other` 的shape不能广播。