Pytorch row by row element-wise multiplication

I’m wondering how to achieve the multiplication like this in Pytorch:

x = [[a, b], [c, d]]
y = [[1, 2], [3, 4]]

result = [[a1, a2, b1, b2], [c3, c4, d3, d4]]

Is ther anyway to avoid doing it row by row in loop? Thanks a lot!

result = torch.repeat_interleave(x, 2, dim=1) * y.repeat(1, 2)

Exactly! Thank you so much!