| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -450,7 +450,18 @@ namespace xt | |||
| 450 | 450 | template <class D> | |
| 451 | 451 | inline bool pycontainer<D>::is_contiguous() const noexcept | |
| 452 | 452 | { | |
| 453 | - return layout_type::dynamic != layout(); | ||
| 453 | + if (PyArray_CHKFLAGS(python_array(), NPY_ARRAY_C_CONTIGUOUS)) | ||
| 454 | + { | ||
| 455 | + return 1 == this->strides().back(); | ||
| 456 | + } | ||
| 457 | + else if (PyArray_CHKFLAGS(python_array(), NPY_ARRAY_F_CONTIGUOUS)) | ||
| 458 | + { | ||
| 459 | + return 1 == this->strides().front(); | ||
| 460 | + } | ||
| 461 | + else | ||
| 462 | + { | ||
| 463 | + return false; | ||
| 464 | + } | ||
| 454 | 465 | } | |
| 455 | 466 | ||
| 456 | 467 | /** | |
| Back | FazBrowse Home | New Git URL |
0 commit comments