We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9308c8f + 478a91a commit 062c8c2Copy full SHA for 062c8c2
include/xtensor-python/pyarray.hpp
@@ -443,7 +443,7 @@ namespace xt
443
// TODO: prevent intermediary shape allocation
444
shape_type shape = xtl::forward_sequence<shape_type, decltype(e.derived_cast().shape())>(e.derived_cast().shape());
445
strides_type strides = xtl::make_sequence<strides_type>(shape.size(), size_type(0));
446
- compute_strides(shape, layout_type::row_major, strides);
+ compute_strides(shape, L, strides);
447
init_array(shape, strides);
448
semantic_base::assign(e);
449
}
test/test_pyarray.cpp
@@ -181,6 +181,18 @@ namespace xt
181
EXPECT_EQ(c(0, 1), a1(0, 1) + a2(0, 1));
182
EXPECT_EQ(c(1, 0), a1(1, 0) + a2(1, 0));
183
EXPECT_EQ(c(1, 1), a1(1, 1) + a2(1, 1));
184
+
185
+ pyarray<int, xt::layout_type::row_major> d = a1 + a2;
186
+ EXPECT_EQ(d(0, 0), a1(0, 0) + a2(0, 0));
187
+ EXPECT_EQ(d(0, 1), a1(0, 1) + a2(0, 1));
188
+ EXPECT_EQ(d(1, 0), a1(1, 0) + a2(1, 0));
189
+ EXPECT_EQ(d(1, 1), a1(1, 1) + a2(1, 1));
190
191
+ pyarray<int, xt::layout_type::column_major> e = a1 + a2;
192
+ EXPECT_EQ(e(0, 0), a1(0, 0) + a2(0, 0));
193
+ EXPECT_EQ(e(0, 1), a1(0, 1) + a2(0, 1));
194
+ EXPECT_EQ(e(1, 0), a1(1, 0) + a2(1, 0));
195
+ EXPECT_EQ(e(1, 1), a1(1, 1) + a2(1, 1));
196
197
198
TEST(pyarray, resize)
0 commit comments