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.
1 parent 7033020 commit a956ad8Copy full SHA for a956ad8
include/xtensor-python/pycontainer.hpp
@@ -450,7 +450,18 @@ namespace xt
450
template <class D>
451
inline bool pycontainer<D>::is_contiguous() const noexcept
452
{
453
- return layout_type::dynamic != layout();
+ 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
465
}
466
467
/**
0 commit comments