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

27 lines
1.1 KiB
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.LeftShift
=======================
.. py:class:: mindspore.ops.LeftShift
将Tensor每个位置的值向左移动几个比特位。
输入是两个Tensor它们的数据类型必须一致并且它们的shape可以广播。
输出不支持隐式类型转换。
.. math::
\begin{aligned}
&out_{i} =x_{i} << y_{i}
\end{aligned}
输入:
- **x1** (Tensor) - 目标Tensor将根据 `x2` 对应位置的值向左移动相应的比特位类型支持int8、int16、int32、int64、uint8、uint16、uint32、uint64。
- **x2** (Tensor) - Tensor必须具有与 `x1` 相同的数据类型且其shape必须与 `x1` 相同或者可以与 `x1` 进行广播。
输出:
- **output** (Tensor) - 输出Tensor数据类型与 `x1` 相同。并且输出Tensor的shape与 `x1` 相同,或者与广播后的 `x1``x2` 的shape相同。
异常:
- **TypeError** - 如果 `x1``x2` 的数据类型错误。
- **TypeError** - 如果 `x1``x2` 不是Tensor。
- **ValueError** - 如果 `x1``x2` 无法广播。