From 2b76061659a94e1593f84be7d311c483e5d24452 Mon Sep 17 00:00:00 2001 From: ZHAOKAI WANG Date: Sat, 10 Jun 2023 05:18:21 +0800 Subject: [PATCH] remove redundant method in `expand_entry` (#9283) --- src/tree/gpu_hist/expand_entry.cuh | 6 ------ src/tree/hist/expand_entry.h | 6 ------ 2 files changed, 12 deletions(-) diff --git a/src/tree/gpu_hist/expand_entry.cuh b/src/tree/gpu_hist/expand_entry.cuh index 41f4c5541..f21563a15 100644 --- a/src/tree/gpu_hist/expand_entry.cuh +++ b/src/tree/gpu_hist/expand_entry.cuh @@ -42,12 +42,6 @@ struct GPUExpandEntry { return true; } - static bool ChildIsValid(const TrainParam& param, int depth, int num_leaves) { - if (param.max_depth > 0 && depth >= param.max_depth) return false; - if (param.max_leaves > 0 && num_leaves >= param.max_leaves) return false; - return true; - } - bst_float GetLossChange() const { return split.loss_chg; } diff --git a/src/tree/hist/expand_entry.h b/src/tree/hist/expand_entry.h index a481cc432..e7e19be06 100644 --- a/src/tree/hist/expand_entry.h +++ b/src/tree/hist/expand_entry.h @@ -26,12 +26,6 @@ struct ExpandEntryImpl { } [[nodiscard]] bst_node_t GetNodeId() const { return nid; } - static bool ChildIsValid(TrainParam const& param, bst_node_t depth, bst_node_t num_leaves) { - if (param.max_depth > 0 && depth >= param.max_depth) return false; - if (param.max_leaves > 0 && num_leaves >= param.max_leaves) return false; - return true; - } - [[nodiscard]] bool IsValid(TrainParam const& param, bst_node_t num_leaves) const { return static_cast(this)->IsValidImpl(param, num_leaves); }