Skip to contents

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

Usage

nvl_popcnt(operand)

Arguments

operand

(tensorish)
Tensorish value of data type integer or unsigned integer.

Value

tensorish
Has the same shape and data type as the input. It is ambiguous if the input is ambiguous.

Implemented Rules

  • stablehlo

  • backward

StableHLO

Lowers to stablehlo::hlo_popcnt().

See also

Examples

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