mindspore.ops.bitwise_left_shift

View Source On Gitee
mindspore.ops.bitwise_left_shift(input, other)[source]

Perform a left bitwise shift operation on the input element-wise, where the number of bits to shift is specified by other.

\[\begin{aligned} &out_{i} =input_{i} << other_{i} \end{aligned}\]
Parameters
  • input (Union[Tensor, int, bool]) – The input to be left shifted.

  • other (Union[Tensor, int, bool]) – The number of bit to be applied on left arithmetic shift.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> 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])