Closed bhosalems closed 2 years ago
If you mean to append the second part to the first, it won't work as you desired to backpropagate through the entire model. For more information, you should check out the PyTorch documentation.
Yeah, once you detach you break the graph and so there's no backpropagation of gradients. I did average directly on tensors based on labels, and it is working now. Thanks anyway.
Hi,
I am writing a training procedure, and was taking the help of run_model() code, here probabilities across the vies are averaged. But that works only if tensor is detached as NumPy array.
Can I dod something like below -
So I was wondering can we detach the tensor in compute_bach_predictions() but still can use it later as a tensor with required grad true to backpropagate?