You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Possible to use 1D and (N-1)D slice iteration with xt::xtensor? #2116
1-D slice iteration (xt::axis_slice_begin1): compiles and run without errors, but all slice are empty (prints {}). Changing the axis does not change the outcome
(N-1)-dimensional iteration: does not compile, fails with
xtensor/xaxis_iterator.hpp:112:24: error: no matching constructor for
initialization of 'shape_type' (aka 'array<unsigned long, 3UL>')
shape_type shape(e_shape.size() - 1);
Desired outcome
Similar iteration as xt::xarray. Eventually with compile time check on the axis (given that shape is known).
Alternative considered
Casting back and forth to an xt::xarray. I am unsure of the performance impacts, if any.
System information
This is running xtensor 0.21.5 from conda-forge and compiling on MacOs with AppleClang 11.0.3
Activity
tdegeus commentedon Sep 7, 2020
That sounds like a bug. Was the only thing you changed with respect to the example the type of the array?
AntoinePrv commentedon Sep 8, 2020
Yes, I recall making a proper test where I only changed the type of the array.
bjmiao commentedon Mar 5, 2021
hi is there any update on this issue?
A similar thing is when I apply axis_end(xt, 0) to an xtensor, the compiler will complain:
I guess this is somehow related to this issue
Fix `xaxis_*_iterator` shape/stride (xtensor-stack#2116)