I have tensor of size [3,1,2,2] ( Consider 3 batch of size (1,2,2) } . I want number which is greater than 0.1 in each batch. Below code gives total count greater than 0.1 which is 8. I want array of [4,3,1] corresponding to value greater than 0.1 in each batch.
a=torch.FloatTensor([[[[0.1807, 0.5755],
          [0.2828, 0.4056]]],


        [[[0.4920, 0.0308],
          [0.8676, 0.2128]]],


        [[[0.0993, 0.9040],
          [0.0488, 0.0790]]]]) 
print(a,a.shape)
b=torch.sum(a>0.1)
print(b)