Thanks so much!
but If I forward using the whole batch and backward using the subset loss, it’s also ok? Are the weights updated according to suset of samples? in another word, Is the average gradient for the subset of samples in this batch?
and how about reweighting the loss, will  .backward() computes the average gradient for the reweighted samples?