xtensor-stack / xtensor-python

Python bindings for xtensor
BSD 3-Clause "New" or "Revised" License
351 stars 58 forks source link

`pyarray` initializers lists work with all layouts #251

Closed adriendelsalle closed 3 years ago

adriendelsalle commented 3 years ago

Description

Make initializer lists work with all layouts. Change default dynamic layout to layout_type::row_major.

adriendelsalle commented 3 years ago

Wait, an additional test:

        pyarray<int, xt::layout_type::dynamic> d
          {{{ 0,  1,  2}, 
            { 3,  4,  5}, 
            { 6,  7,  8}}, 
           {{ 9, 10, 11}, 
            {12, 13, 14}, 
            {15, 16, 17}}}; 

        EXPECT_EQ(d.layout(), xt::layout_type::dynamic); // FAIL, xt::layout_type::column_major

shows that the default layout is not dynamic.

adriendelsalle commented 3 years ago

Everything should be fixed:

@JohanMabille this should be ready to merge!