Solved by richard in post #2 
              
              
                Look at the broadcasting semantics on the docs: http://pytorch.org/docs/master/notes/broadcasting.html 
You have two tensors that don’t have the same size, so the broadcasting semantics comes in. 
First, (16) is compared to (16, 1) in the trailing dimension first. 1 can be broadcasted to 16 so the t…