Skip to content

Commit

Permalink
Resolve.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed May 20, 2020
1 parent ff052f2 commit 6fb4e86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tree/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ XGBOOST_DEVICE inline T CalcGainGivenWeight(const TrainingParams &p,

// calculate the cost of loss function
template <typename TrainingParams, typename T>
XGBOOST_DEVICE inline T CalcGain(const TrainingParams &p, T sum_grad, T sum_hess) {
XGBOOST_DEVICE inline T CalcGain(const TrainingParams &p, T const& sum_grad, T const& sum_hess) {
if (sum_hess < p.min_child_weight) {
return T(0.0);
}
Expand All @@ -295,8 +295,8 @@ XGBOOST_DEVICE inline T CalcGain(const TrainingParams &p, T sum_grad, T sum_hess
}

template <typename TrainingParams,
typename StatT, typename T = decltype(StatT().GetHess())>
XGBOOST_DEVICE inline T CalcGain(const TrainingParams &p, StatT stat) {
typename StatT, typename T = typename std::remove_reference< decltype(StatT().GetHess()) >::type>
XGBOOST_DEVICE inline T CalcGain(const TrainingParams &p, StatT const& stat) {
return CalcGain(p, stat.GetGrad(), stat.GetHess());
}

Expand Down

0 comments on commit 6fb4e86

Please sign in to comment.