Hi!
I have a (32x750) tensor
tensor([[ 0.0000,  0.0000,  0.0000,  ...,  0.0000,  0.0000,  0.0043],
        [ 0.0000,  0.0000,  0.0000,  ...,  0.0000,  0.0000,  0.0043],
        [ 0.0000,  0.0044,  0.0000,  ...,  0.0044,  0.0000,  0.0000],
        ...,
        [ 0.0059,  0.0000,  0.0059,  ...,  0.0059,  0.0000,  0.0000],
        [ 0.0059,  0.0000,  0.0059,  ...,  0.0059,  0.0000,  0.0000],
        [ 0.0000,  0.0000,  0.0000,  ...,  0.0000,  0.0056,  0.0000]], device='cuda:0')

And I want to get  the number of nonzero elements along each rows. Something like that
[12 47 0 5 .... 8 7 50]
This discussion 127 didn’t solve my problem and concerned the number of nonzero elements for 1-D tensor.
Thanks