The sizes are unfortunately not right, as the code still raises:
RuntimeError: mat1 dim 1 must match mat2 dim 0

so could you please double check the shapes and/or post an executable code snippet, so that we could debug it?