xtensor-python icon indicating copy to clipboard operation
xtensor-python copied to clipboard

Enable load cast `xt::xtensor<...>`

Open tdegeus opened this issue 4 years ago • 0 comments

Sometimes my API simply does not permit easily to template, or I just want to wrap quick and dirty, or on needs to work around a bug. For these case I still want to be able to wrap

void foo(const xt::xtensor<double, 1>& a);

Currently this is explicitly prohibited in xtensor-python https://github.com/xtensor-stack/xtensor-python/blob/9aa58f8a5316548bb382e6f14aa557c2c96d9399/include/xtensor-python/xtensor_type_caster_base.hpp#L77-L80

I find this too restrictive, and I think that xtensor-python should have a way to do it, for instance by setting a flag or include a header. We should give the possibility to work around something, even if it comes at the cost of a copy.

tdegeus avatar May 30 '21 12:05 tdegeus