Yes, it works. except that, if you add
s  = sum([np.prod(list(p.size())) for p in m1.parameters()]);
print (‘Number of params: %d’ % s)
It prints 22. Which means, that you have 22 parameters for each of m1 and m2, but only 2 of them are alike. And
if m1.parameters() != m2.parameters():
print(True)
prints True.