| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9308c8f commit 478a91a
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -443,7 +443,7 @@ namespace xt | |||
| 443 | 443 | // TODO: prevent intermediary shape allocation | |
| 444 | 444 | shape_type shape = xtl::forward_sequence<shape_type, decltype(e.derived_cast().shape())>(e.derived_cast().shape()); | |
| 445 | 445 | strides_type strides = xtl::make_sequence<strides_type>(shape.size(), size_type(0)); | |
| 446 | - compute_strides(shape, layout_type::row_major, strides); | ||
| 446 | + compute_strides(shape, L, strides); | ||
| 447 | 447 | init_array(shape, strides); | |
| 448 | 448 | semantic_base::assign(e); | |
| 449 | 449 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -181,6 +181,18 @@ namespace xt | |||
| 181 | 181 | EXPECT_EQ(c(0, 1), a1(0, 1) + a2(0, 1)); | |
| 182 | 182 | EXPECT_EQ(c(1, 0), a1(1, 0) + a2(1, 0)); | |
| 183 | 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)); | ||
| 184 | 196 | } | |
| 185 | 197 | ||
| 186 | 198 | TEST(pyarray, resize) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments