What the M does is to add the random number generated by the 2 by 3 matrix while the  mat1 and mat2 are multiply together
that
it will add mat1 and mat2 and multiply the final matrix by M
and the M rep the mat in the addmm