I am having the same issue where tracing through backward() gives me the same error: RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
. The stack trace reports loss.backward()
as being the issue, but loss requires a grad.
It looks like tracing backward() calls should be supported…