Skip to contents

Element-wise population count (number of set bits).

Usage

nv_popcnt(operand)

Arguments

operand

(tensorish)
Operand.

Value

tensorish
Has the same shape and data type as the input.

See also

nvl_popcnt() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(c(7L, 3L, 15L))
  nv_popcnt(x)
})
#> AnvilTensor
#>  3
#>  2
#>  4
#> [ CPUi32{3} ]