jax.lax.population_count#
- jax.lax.population_count(x)[source]#
Elementwise popcount,计算每个元素中设置的位数。
此函数直接降低到 stablehlo.popcnt 操作。
- 参数:
x (ArrayLike) – 输入数组。必须具有整数 dtype。
- 返回:
与
x
形状和 dtype 相同的数组,其中包含输入中设置的位数。- 返回类型:
另请参阅
jax.lax.clz()
:Elementwise 计算前导零。jax.numpy.bitwise_count()
:更灵活的 NumPy 风格的位计数 API。