File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ class EvalPrecision : public EvalRankWithCache<ltr::MAPCache> {
330330
331331 common::ParallelFor (p_cache->Groups (), ctx_->Threads (), [&](auto g) {
332332 auto g_label = h_label.Slice (linalg::Range (gptr[g], gptr[g + 1 ]));
333- auto g_rank = rank_idx.subspan (gptr[g]);
333+ auto g_rank = rank_idx.subspan (gptr[g], gptr[g + 1 ] - gptr[g] );
334334
335335 auto n = std::min (static_cast <std::size_t >(param_.TopK ()), g_label.Size ());
336336 double n_hits{0.0 };
@@ -438,7 +438,7 @@ class EvalMAPScore : public EvalRankWithCache<ltr::MAPCache> {
438438
439439 common::ParallelFor (p_cache->Groups (), ctx_->Threads (), [&](auto g) {
440440 auto g_label = h_label.Slice (linalg::Range (gptr[g], gptr[g + 1 ]));
441- auto g_rank = rank_idx.subspan (gptr[g]);
441+ auto g_rank = rank_idx.subspan (gptr[g], gptr[g + 1 ] - gptr[g] );
442442
443443 auto n = std::min (static_cast <std::size_t >(param_.TopK ()), g_label.Size ());
444444 double n_hits{0.0 };
You can’t perform that action at this time.
0 commit comments