RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

Here’s a thread on why we sometimes want to detach outputs.