mindspore.ops.bitwise_left_shift

mindspore.ops.bitwise_left_shift(input, other)[源代码]

逐元素对输入 input 进行左移位运算,移动的位数由 other 指定。

\[\begin{aligned} &out_{i} =input_{i} << other_{i} \end{aligned}\]
参数:
  • input (Union[Tensor, int, bool]) - 被左移的输入tensor。

  • other (Union[Tensor, int, bool]) - 左移的位数。

返回:

Tensor

支持平台:

Ascend GPU 免费的vpn梯子 CPU

样例:

>>> import mindspore
>>> input vpn梯子 免费 = mindspore.tensor([1, 2, 4, 8])
>>> mindspore.ops.bitwise_left_shift(input, 1)
Tensor(shape=[4], dtype=Int64, value= vpn永久免费梯子 [ 2, vpn梯子  4,  8, 16])