From 5637a5213b039817207ea8b1ac0586d61effc505 Mon Sep 17 00:00:00 2001 From: Thibault Hallouin <thibault.hallouin@inrae.fr> Date: Thu, 23 Feb 2023 10:54:18 +0100 Subject: [PATCH] fix dimension mismatch when multi-dim inputs --- include/evalhyd/detail/probabilist/brier.hpp | 6 ++++-- include/evalhyd/detail/probabilist/evaluator.hpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/evalhyd/detail/probabilist/brier.hpp b/include/evalhyd/detail/probabilist/brier.hpp index 013395e..5e7e73d 100644 --- a/include/evalhyd/detail/probabilist/brier.hpp +++ b/include/evalhyd/detail/probabilist/brier.hpp @@ -508,7 +508,8 @@ namespace evalhyd for (std::size_t e = 0; e < n_exp; e++) { // retrieve length of period - auto l = xt::view(t_counts, xt::all(), xt::all(), m, e); + auto l = xt::view(t_counts, xt::all(), xt::all(), + m, xt::newaxis(), e); // retrieve range of forecast values $y_i$ auto y_i = xt::eval( @@ -670,7 +671,8 @@ namespace evalhyd xt::all(), b_exp[e]); // retrieve length of period - auto l = xt::view(t_counts, xt::all(), xt::all(), m, e); + auto l = xt::view(t_counts, xt::all(), xt::all(), + m, xt::newaxis(), e); // compute mask to subsample time steps belonging to same observation bin // (where bins are defined as the range of forecast values) diff --git a/include/evalhyd/detail/probabilist/evaluator.hpp b/include/evalhyd/detail/probabilist/evaluator.hpp index c3dc966..88eb136 100644 --- a/include/evalhyd/detail/probabilist/evaluator.hpp +++ b/include/evalhyd/detail/probabilist/evaluator.hpp @@ -390,7 +390,7 @@ namespace evalhyd ); } return qs.value(); - };; + }; xt::xtensor<double, 3> get_crps() { -- GitLab