n-D spline class (PyTorch)