Solved by Ada in post #10 
              
              
                Yes, target['a'] is supposed to be a list. 
In your first post, you showed: 

This means you initialized target['a'] to be a list, and then, in the loop, appended a tensor to the list at each iteration.  I.e., at the end of the loop, we should have target['a'] = [act['a'],...,act['a']] where act['a'…