You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing a tensor to the model, collecting the loss, and calling loss.backward(), i'm getting the error: Element 0 of tensors does not require grad and does not have a grad_fn
When passing a tensor to the model, collecting the loss, and calling
loss.backward()
, i'm getting the error:Element 0 of tensors does not require grad and does not have a grad_fn
Here's a minimum reproduceable code:
where I expect the loss tensor to have a grad_fcn, and / or
requires_grad=True
.like
from here
Please help me.
The text was updated successfully, but these errors were encountered: