when I do this part
x5.view(self.batchsize, -1)
I’ll have a tensor of size (batchsize,100)
if I apply your version I’ll have a tensor of one dimension.
I still need the sum of the value of the second dimension which means I want to have (batchsize,1)