I am getting “there are no graph nodes that require computing gradients”. Is it because this operation is not differentiable?
def distance(input, means):
     df = 1
     dist = torch.zeros(self.means.size(0), input.size(0))
     for i in range(self.means.size()[0]):
          dist[i] = torch.pow(1 + torch.sum(torch.pow(input - self.means[i], 2), 1) / df, -(1 + df)/2).data
     return dist.t()

If not, can you please show me what is thecorrect way to make this operation differentiable?