Hi, I’m trying to use softamx2d and I can’t see what I’m doing wrong.
I will show my problem using something that will be easier to understand.
I have this 2d matrix of values and I want to make her to a probabilities matrix:

image.png1096×892 155 KB

so I’m using this code:
    self.softmax=nn.Softmax2d()

    result = self.softmax(result)

But I’m getting this result, all 0…, take a look:

image.png1131×878 56.3 KB

I can’t understand why? my “sanity-check” is that the sum of element of the entire matrix suppose to sum to 1 (I tried to make the precision bigger, no luck).
I know I’m missing something, can’t understand what.
Please help, Thanks!