Ofcourse, there are many ways to make the operation equivalent in calculating gradients. It’s just not advised to do access .data, if you want to completely depend on autograd for the accuracy of your gradients.
From your question on the top,  I feel that your use case would be achievable by using .repeat() function of tensor.  Can you have a look?
for example,  you can say
y = w.repeat(1,2) * x.repeat(1,2)