Open songjhaha opened 2 years ago
@pabloferz could you have a look at this?
@pabloferz I'm currently wondering how to combine JAX with DifferentiationInterface and your package seems like the way to go! Should I always implement contiguity checks before every transfer or is there an easier solution to this issue?
@gdalle DLPack does not impede handling non contiguous arrays (but they need to be strided). That said, unfortunately JAX does check for that (at least it did some time ago, not sure that has changed) and errors if that's not the case, so for JAX in particular I believe you need to make sure arrays are contiguous before transferring.
A small example:
Although this situation is not so common in normal usage.