Solved by tom in post #3 
              
              
                This isn’t what you think it is (it is the size of a value of the ScalarType type), you probably want elementSize(torch::Int32). 
Best regards 
Thomas