Skip to content

Commit 7bba719

Browse files
committed
cleanup.
1 parent d3525b0 commit 7bba719

File tree

3 files changed

+0
-10
lines changed

3 files changed

+0
-10
lines changed

Diff for: src/common/ranking_utils.cc

-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ void RankingCache::InitOnCPU(Context const* ctx, MetaInfo const& info) {
4343
sum_weights += weight[k];
4444
}
4545
weight_norm_ = static_cast<double>(n_groups) / sum_weights;
46-
47-
auto const& h_label = info.labels.HostView().Slice(linalg::All(), 0);
48-
is_binary_ = IsBinaryRel(
49-
h_label, [ctx](auto beg, auto end, auto op) { return common::AllOf(ctx, beg, end, op); });
5046
}
5147

5248
common::Span<std::size_t const> RankingCache::MakeRankOnCPU(Context const* ctx,

Diff for: src/common/ranking_utils.cu

-3
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ void RankingCache::InitOnCUDA(Context const* ctx, MetaInfo const& info) {
173173
auto w_it =
174174
dh::MakeTransformIterator<double>(thrust::make_counting_iterator(0ul), WeightOp{weight});
175175
weight_norm_ = static_cast<double>(n_groups) / thrust::reduce(w_it, w_it + n_groups);
176-
177-
auto const d_label = info.labels.View(ctx->gpu_id).Slice(linalg::All(), 0);
178-
is_binary_ = IsBinaryRel(d_label, CheckMAPOp{ctx->CUDACtx()});
179176
}
180177

181178
common::Span<std::size_t const> RankingCache::MakeRankOnCUDA(Context const* ctx,

Diff for: src/common/ranking_utils.h

-3
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ class RankingCache {
162162
std::size_t max_group_size_{0};
163163
// Normalization for weight
164164
double weight_norm_{1.0};
165-
// Whether label is binary
166-
bool is_binary_{false};
167165
/**
168166
* CUDA cache
169167
*/
@@ -227,7 +225,6 @@ class RankingCache {
227225
[[nodiscard]] auto const& Param() const { return param_; }
228226
[[nodiscard]] std::size_t Groups() const { return group_ptr_.Size() - 1; }
229227
[[nodiscard]] double WeightNorm() const { return weight_norm_; }
230-
[[nodiscard]] bool IsBinary() const { return is_binary_; }
231228

232229
// Create a rank list by model prediction
233230
common::Span<std::size_t const> SortedIdx(Context const* ctx, common::Span<float const> predt) {

0 commit comments

Comments
 (0)