From 80bee700c10b95b3fa5b48a617aeb81e88a7e7db Mon Sep 17 00:00:00 2001 From: Brede Johansen Date: Mon, 2 Oct 2023 17:04:16 +0200 Subject: [PATCH 1/3] Fix warning in xrepeat --- include/xtensor/xrepeat.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xtensor/xrepeat.hpp b/include/xtensor/xrepeat.hpp index 09c792bdd..03ca3c525 100644 --- a/include/xtensor/xrepeat.hpp +++ b/include/xtensor/xrepeat.hpp @@ -263,7 +263,7 @@ namespace xt , m_shape(e.shape()) { using shape_value_type = typename shape_type::value_type; - m_shape[axis] = static_cast(std::accumulate(m_repeats.begin(), m_repeats.end(), 0)); + m_shape[axis] = static_cast(std::accumulate(m_repeats.begin(), m_repeats.end(), shape_value_type{})); } /** From 0f2a7874e5ba699eddf8afdb7dd49e00ffd97c74 Mon Sep 17 00:00:00 2001 From: bredej Date: Thu, 12 Oct 2023 11:10:55 +0200 Subject: [PATCH 2/3] Update xrepeat.hpp --- include/xtensor/xrepeat.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xtensor/xrepeat.hpp b/include/xtensor/xrepeat.hpp index 03ca3c525..d84a4a300 100644 --- a/include/xtensor/xrepeat.hpp +++ b/include/xtensor/xrepeat.hpp @@ -263,7 +263,7 @@ namespace xt , m_shape(e.shape()) { using shape_value_type = typename shape_type::value_type; - m_shape[axis] = static_cast(std::accumulate(m_repeats.begin(), m_repeats.end(), shape_value_type{})); + m_shape[axis] = static_cast(std::accumulate(m_repeats.begin(), m_repeats.end(), shape_value_type(0))); } /** From 40f61859b0fa9952c0369e7e9961e07763eb90b3 Mon Sep 17 00:00:00 2001 From: Tom de Geus Date: Sun, 15 Oct 2023 14:05:05 +0200 Subject: [PATCH 3/3] Update include/xtensor/xrepeat.hpp --- include/xtensor/xrepeat.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/xtensor/xrepeat.hpp b/include/xtensor/xrepeat.hpp index d84a4a300..d16125530 100644 --- a/include/xtensor/xrepeat.hpp +++ b/include/xtensor/xrepeat.hpp @@ -263,7 +263,9 @@ namespace xt , m_shape(e.shape()) { using shape_value_type = typename shape_type::value_type; - m_shape[axis] = static_cast(std::accumulate(m_repeats.begin(), m_repeats.end(), shape_value_type(0))); + m_shape[axis] = static_cast( + std::accumulate(m_repeats.begin(), m_repeats.end(), shape_value_type(0)) + ); } /**