Mantas:

tensors does not require grad


This is the part of the message that says that the Tensor you called backward on doesn’t require gradients. Which means that it was involved in a non-differentiable op.