Hi,
This error is because no element with requires_grad=True has been used in the computations.
This may be due to the fact that you model contains no learnable parameter and your inputs does not require grad.
Or it can be due to the fact that out is independent of all the elements that requires_grad=True