fn
bitwise_left_shift_op
→TensorImplPtrint bitwise_left_shift_op(const int & a, const int & b)Python wrappers
Public Python APIs implemented by this engine symbol.Element-wise left shift.
Computes out[i] = a[i] << b[i] for every element. Defined only on
signed integer dtypes (I8/I16/I32/I64); Bool is
rejected because shifting a bit has no defined meaning.
Non-differentiable: no autograd node is registered.
Math
Out-of-range shift amounts follow the underlying C++ operator<<
semantics for signed integers; callers should clamp b to
[0, bitwidth) to stay portable.
References
NumPy numpy.left_shift.
See Also
bitwise_right_shift_op
Parameters
aTensorImplPtrValue to shift. Signed integer dtype.
bTensorImplPtrShift amount per element. Must match
a in shape, dtype, and device.Returns
TensorImplPtrTensor of the same shape and dtype as the inputs.
Raises
LucidErrorIf shapes/devices differ, or if the input dtype is not one of
I8/I16/I32/I64.Notes
- Floating-point and Bool inputs are rejected at the dispatch layer.
- No broadcasting — shapes must match exactly.