Solved by tom in post #2 
              
              
                Semi-supervised learning is a relatively common technique to deal with situations in which labeled data isn’t abundant and might look like this. 
PyTorch’s autograd it is much the same if the loss has 1, 2, or 10 terms - losses of minibatches typically are just sums or means of the individual items …