Solved by albanD in post #2 
              
              
                Hi, 
None of them is dot product. They both are element-wise multiplication. 
Dot product/matrix multiplication is done with torch.mm or torch.mv or the @ symbol in python3.