@richard I did not. It shouldn’t be required in this case, though, as the series of operations are all primitives (+,-, etc.) or built-in Pytorch functions. I am doing a NN search using PyFLANN (offline), then using those indices to sample my dataset, and subsequently finding the Euclidean distance between data points. Ultimately I take the average over all.
The operations I use are torch.index_select(), torch.sqrt(), torch.mean() and torch.sum(), along with +, -, and ** (power).
If absolutely necessary I can share the function here if that helps (although I’m avoiding posting it here as it’s research related).