mindspore.ops.PopulationCount
- class mindspore.ops.PopulationCount[source]
Computes element-wise population count(a.k.a bitsum, bitcount).
Refer to
mindspore.ops.population_count()
for more details.- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> input_x = Tensor([0, 1, 3], mindspore.int16) >>> output = ops.PopulationCount()(input_x) >>> print(output) [0 1 2]