mindspore.ops.bitwise_left_shift
- 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
- Returns
Tensor, the result after bitwise left shift.
- Raises
TypeError – If neither input nor other is a tensor.
TypeError – If either input or other is not a bool, int or a tensor of dtype: int or uint.
TypeError – If input and other do not have the same dtype.
ValueError – If input and other could not be broadcast.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> input = Tensor(np.array([1024, 2]), mindspore.int16) >>> other = Tensor(np.array([2]), mindspore.int16) >>> output = ops.bitwise_left_shift(input, other) >>> print(output) [4096 8]