dpnp.left_shift
- dpnp.left_shift(x1, x2, /, out=None, *, order='K', where=True, dtype=None, subok=True, **kwargs)[source]
Shift the bits of an integer to the left.
For full documentation refer to
numpy.left_shift.- Returns:
out – An array containing the element-wise results.
- Return type:
dpnp.ndarray
Limitations
Parameters x1 and x2 are supported as either scalar,
dpnp.ndarrayordpctl.tensor.usm_ndarray, but both x1 and x2 can not be scalars at the same time. Parameters where, dtype and subok are supported with their default values. Keyword argument kwargs is currently unsupported. Otherwise the function will be executed sequentially on CPU. Input data is supported as integer only.See also
dpnp.right_shiftShift the bits of an integer to the right.
Examples
>>> import dpnp as np >>> x1 = np.array([5]) >>> x2 = np.array([1, 2, 3]) >>> np.left_shift(x1, x2) array([10, 20, 40])
The
<<operator can be used as a shorthand forleft_shiftondpnp.ndarray.>>> x1 << x2 array([10, 20, 40])