xtensor icon indicating copy to clipboard operation
xtensor copied to clipboard

axis_slice_iterator and axis_iterator do not function with xtensors

Open dchansen opened this issue 2 years ago • 4 comments

axis slice iterator is broken when used with xtensors (godbolt) and axis_iterator simply does not compile.

This issue for both cases is that the strides_type and shape_type in axis_slice_iterator and axis_iterator are taken from the given xexpression, which is not correct for xtensor as the resulting strided_view should anyhow be dynamically sized.

The alternative would be to assign a dynamic strides and shape_type, but it was not clear to me what the correct replacement type should be.

dchansen avatar Aug 31 '23 12:08 dchansen

This appears to be a duplicate of #2116.

Stef-Sijben avatar Nov 22 '23 13:11 Stef-Sijben

The godbolt example appears to compile in all 3 major compilers.

spectre-ns avatar Nov 27 '23 12:11 spectre-ns

Yes - but they also produce the wrong output (see the output tab). The shape reported is (2, 0, 0) in this example

dchansen avatar Nov 27 '23 12:11 dchansen

Yes - but they also produce the wrong output (see the output tab). The shape reported is (2, 0, 0) in this example

Ahh... Yes, I see that now.

spectre-ns avatar Nov 28 '23 00:11 spectre-ns