Thank you. I made some changes. Now, the following issue occurs:
I need to update the values in f1 for every batch based on the model’s subgroup performance.
When I tried using the indices like f1[i] = new value, I got the following error:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [64, 1]], which is output 0 of TBackward, is at version 3; expected version 2 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!
How can I update the value of f1 for every batch while training?