jax.lax.population_count#
- jax.lax.population_count(x)[source]#
Elementwise popcount, count the number of set bits in each element.
This function lowers directly to the stablehlo.popcnt operation.
- Parameters:
x (ArrayLike) – Input array. Must have integer dtype.
- Returns:
An array of the same shape and dtype as
x
, containing the number of set bits in the input.- Return type:
See also
jax.lax.clz()
: Elementwise count leading zeros.jax.numpy.bitwise_count()
: More flexible NumPy-style API for bit counts.