I have a nd array of tensors with gradeints:
lis = [0,1,2]
ae = torch.tensor(lis, dtype = torch.float, requires_grad=True)
aqw =np.array([ae[0], ae[1],ae[2]])
I need to convert into a tensor with gradients intact. I tried torch.from_numpy but it losses the grads and I want to have a use case like this, I do not want to perform my computations in torch but in numpy