Skip to content

Slice iteration not working with xt::xtensor #2543

@czajah

Description

@czajah
 xt::xtensor<float_type,3> a = {{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}, {{13, 14, 15, 16}, {17, 18, 19, 20}, {21, 22, 23, 24}}}; auto a_iter = xt::axis_slice_begin(a, 2u); auto a_end = xt::axis_slice_end(a, 2u); while(a_iter != a_end) { std::cout << *a_iter++ << std::endl; } 

produces:

{} {} {} {} {} {} 

while after change from xt::xtensor<float_type,3> to xt::xarray<float_type> produces expected output

{ 1., 2., 3., 4.} { 5., 6., 7., 8.} { 9., 10., 11., 12.} { 13., 14., 15., 16.} { 17., 18., 19., 20.} { 21., 22., 23., 24.} 

xtensor built from master (last commit d1499d9)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions