I am implementing my own loss function following http://pytorch.org/docs/notes/extending.html#extending-torch-autograd 49.
However, after my implementation of forward(self, input), during forward pass, the input, which is a Variable, is converted into a floatTensor. Since my function is a loss function, the output becomes just a float number. Pytorch throw out an error:
RuntimeError: data must be a Tensor
How can I fix this problem?
Thanks