mindspore.Tensor.count_nonzero

Tensor.count_nonzero(axis=(), keep_dims=False, dtype=mstype.int32)[source]

For details, please refer to mindspore.ops.count_nonzero().