Have you tried enabling anomaly detection as suggested in the error message and if so, was the stack trace pointing to torch.stack?
This would be unusual, as torch.stack wouldn’t modify the tensors inplace assuming neighs is e.g. a list of separate tensors. In case you get stuck, could you try to come up with a minimal executable code snippet so that we could try to debug it?