Skip to content

Commit 7033020

Browse files
committed
Compatibility for upstream xtensor change
The upstream change broke the build: xtensor-stack/xtensor@da7de15 Add pycontainer::is_contiguous to make xtensor happy.
1 parent c19dae6 commit 7033020

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/xtensor-python/pycontainer.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ namespace xt
9393
void reshape(S&& shape, layout_type layout = base_type::static_layout);
9494

9595
layout_type layout() const;
96+
bool is_contiguous() const noexcept;
9697

9798
using base_type::operator();
9899
using base_type::operator[];
@@ -442,6 +443,16 @@ namespace xt
442443
}
443444
}
444445

446+
/**
447+
* Return whether or not the container uses contiguous buffer
448+
* @return Boolean for contiguous buffer
449+
*/
450+
template <class D>
451+
inline bool pycontainer<D>::is_contiguous() const noexcept
452+
{
453+
return layout_type::dynamic != layout();
454+
}
455+
445456
/**
446457
* Import the numpy Python module.
447458
*/

0 commit comments

Comments
 (0)