1-D spline class (PyTorch)