mindspore.ops.bitwise_left_shift

查看源文件
mindspore.ops.bitwise_left_shift(input, other)[源代码]

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

outi=inputi<<otheri
参数:
  • input (Union[Tensor, int, bool]) - 被左移的输入tensor。

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

返回:

Tensor

支持平台:

Ascend GPU CPU

样例:

>>> import mindspore
>>> input = mindspore.tensor([1, 2, 4, 8])
>>> mindspore.ops.bitwise_left_shift(input, 1)
Tensor(shape=[4], dtype=Int64, value= [ 2,  4,  8, 16])