The following code causes a RuntimeError ’ unsupported operation: more than one element of the written-to tensor refers to a single memory location. Please clone() the tensor before performing the operation’. Could anyone help me?
import torch
kx = torch.linspace(-64, 63, 128)
kY0, kX0 = torch.meshgrid(kx, kx)
kX0 *= 0.001
kY0 *= 0.001