I just slightly changed SoftMax to make sure that if input is 0, then output will be 0 as well.
but I got the error image from the loss function:
RuntimeError: Function ‘LogBackward0’ returned nan values in its 0th output.
Is that something wrong with the epsilon settings?
Can you share a minimal reproducible example? I can see your function could failing in the case of eps=0 and your x Tensor containing a zero, as you’d be dividing by zero.