Element-wise left bit shift.
Value
(arrayish)
Has the inputs' broadcast shape and x's data type.
See also
prim_shift_left() for the underlying primitive.
Examples
x <- nv_array(c(1L, 2L, 4L))
shift <- nv_array(c(1L, 2L, 1L))
nv_shift_left(x, shift)
#> AnvlArray
#> 2
#> 8
#> 8
#> [ CPUi32{3} ]
# the result keeps `x`'s data type, which `shift` is brought to
nv_shift_left(nv_scalar(8L, "i64"), nv_scalar(2L, "i32"))
#> AnvlArray
#> 32
#> [ CPUi64{} ]
# a scalar is broadcast
nv_shift_left(x, 1L)
#> AnvlArray
#> 2
#> 4
#> 8
#> [ CPUi32{3} ]