We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7cb644a commit a26ca70Copy full SHA for a26ca70
1 file changed
include/xtensor-python/pycontainer.hpp
@@ -473,7 +473,11 @@ namespace xt
473
template <class D>
474
inline bool pycontainer<D>::is_contiguous() const noexcept
475
{
476
- if (PyArray_CHKFLAGS(python_array(), NPY_ARRAY_C_CONTIGUOUS))
+ if (this->strides().size() == 0)
477
+ {
478
+ return true;
479
+ }
480
+ else if (PyArray_CHKFLAGS(python_array(), NPY_ARRAY_C_CONTIGUOUS))
481
482
return 1 == this->strides().back();
483
}
0 commit comments