Initialize two lstms with same weight

I am implementing a siamese network and in for that i have to make two lstms have same weights initially. I am not getting how to get weight tensors of first one and assign it to second.

for p, q in zip(lstm1,parameters(), lstm2.parameters()):
  p.data.copy_(q.data)
1 Like