When trying to implement a custom autograd.Function, I’m calling torch.from_numpy(x) inside the backward() definition of the custom function. However, this doesn’t work. Replacing torch.from_numpy(x) with torch.zeros(…) works. Copying over all values one-by-one from numpy array ‘x’ to the fresh torch.zeros(…) tensor works. What am I doing wrong? Also, the example for custom modules from numpy and scipy doesn’t work.