Hey,
I am trying to generate kind of procedural displacement maps using Fibonacci sphere coordinates.
Basically the following code is generating me 2d coordinates I am using later own to create my texture.

seed_nb = torch.tensor(600,device = pyredner.get_device(), requires_grad=True)
goldenRatio = torch.tensor((1 + 5**0.5)/2,device = pyredner.get_device())
i = torch.arange(0, seed_nb.long(),device = pyredner.get_device())
theta      = 2 * torch_PI * i / goldenRatio
fibo_phi   = torch.acos(torch.ones(1,device = pyredner.get_device()) - torch.tensor(2*(i+0.5)/n,device = pyredner.get_device()))
fibo_theta = (theta%(2torch_PI))-torch_PI
# print(phi.min(),phi.max(),theta.min(),theta.max())
indices_x = (fibo_phi1800/np.pi).long()
indices_y = ( ((fibo_theta*1800/np.pi)+1800)).long()

The problem is that I want the variable “seed_nb” to be differentiable/learned to be the right value when back-propagating. So I used a long tensor with one value inside. But because or “torch.arange” it sees that the gradient of this tensor is always None, hence nothing is learned.
I am a bit stuck trying to find a way to go around this arange somehow.
Any idea ?
Justin