Solved by KFrank in post #2 
              
              
                Hi Harpal! 

This detach() is wrong: 
bce_loss(meta_preds.detach().cpu(), meta_cats_batch)

It “breaks the computation graph” in that it  “detaches” meta_preds 
from the computation of bce_loss() so that you don’t  backpropagate 
through, and optimize, the weights that were used to produce 
meta_pre…