Sandeep_Kumar_GITAM:

            output = torch.exp((self.gamma*(((input_unfold - weight_flat)**2).abs().sum(dim=2).mul(-1)).sqrt()))



You’re taking the inverse of a negative number here, that’s why you’re getting NaNs