Hey all 
@albanD I do have a follow up question.
Its very much related to what was already asked but I struggle with the ideal solution.
I am having an RL agent running through its environment collecting samples.
Some of the samples are from its own predictions. However, the PyTorch model has two separate output heads and for one of those output heads, I want to remove samples from the loss. The removal should be done to not influence any of the gradients for these particular samples within the 64 sized batch. What I’ve done so far is to just set the corresponding entries to zero and then do the .sum() or .mean() operation in order to get the loss scalar value. I couldn’t really find anything about setting entries in the loss vector to zero and its related backprob tree.
So I am having a mask for which those entries selected by the mask should not influence the learning process at all. How should I proceed ?
Thanks in advance