From ded8b0e2985beb1aed4a661aa80318b1a0f66ac1 Mon Sep 17 00:00:00 2001 From: Lukas Tenbrink Date: Thu, 10 Oct 2024 21:56:44 +0200 Subject: [PATCH] Fill xcontainers of dynamic layout contiguously if their runtime layout is contiguous --- include/xtensor/containers/xcontainer.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xtensor/containers/xcontainer.hpp b/include/xtensor/containers/xcontainer.hpp index 70ebaa798..a7fbdf743 100644 --- a/include/xtensor/containers/xcontainer.hpp +++ b/include/xtensor/containers/xcontainer.hpp @@ -422,7 +422,7 @@ namespace xt template inline void xcontainer::fill(const T& value) { - if (contiguous_layout) + if (contiguous_layout || this->is_contiguous()) { std::fill(this->linear_begin(), this->linear_end(), value); }