Adding distances.clone() (copying the existing deltas.clone()) stops autograd complaining about the in-place operation when using pytorch==1.13.
Also changed the test_neighbor_grad test so that it runs on CPU and GPU separately (so it can run on Github Actions CI) and compares the NNPOps gradients with reference gradients calculated using pytorch autograd.
This aims to fix #84
Adding
distances.clone()
(copying the existingdeltas.clone()
) stops autograd complaining about the in-place operation when using pytorch==1.13.Also changed the
test_neighbor_grad
test so that it runs on CPU and GPU separately (so it can run on Github Actions CI) and compares the NNPOps gradients with reference gradients calculated using pytorch autograd.