patrick-kidger / torchcubicspline

Interpolating natural cubic splines. Includes batching, GPU support, support for missing values, evaluating derivatives of the spline, and backpropagation.
Apache License 2.0
198 stars 18 forks source link

Complex value compatibility #9

Closed StephenHogg closed 2 years ago

StephenHogg commented 2 years ago

Hi,

Thanks for putting this together, it's a really useful bit of code. I wonder what it would take to make it compatible with complex dtypes? I'd be very grateful for any advice you could provide. Hope this isn't a bother.

Regards,

Stephen

patrick-kidger commented 2 years ago

I'm not sure. I haven't tried it with complex dtypes. If you find it has issues with complex dtypes then I'd be happy to accept a PR fixing such issues. As a workaround you could also convert your complex data into real data, with twice the channels, pass it through the cubic spline code and then convert back again.

StephenHogg commented 2 years ago

Thanks, I'll look into doing that!