Solved by ptrblck in post #5 
              
              
                As shown in my minimal code snippet, the weight shape is wrong in your code, so you would have to permute it to the expected shape, i.e. swap dim0 with dim1.