I’m using this way but it is taking the sum of all the 2D matrix instead of what is greater only
number of elements that are greater then zero = x5.view(self.batchsize, -1).ge(0).sum(1).float()
sum of all elements divided by the number of grater than zero = x5.view(self.batchsize, -1).sum(1).div(g)
I want this term. the average of the number greater than zero in dimension 1