Upgrade clang-tidy on CI. (#5469)
* Correct all clang-tidy errors. * Upgrade clang-tidy to 10 on CI. Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
@@ -319,7 +319,7 @@ struct EvalTweedieNLogLik {
|
||||
*/
|
||||
template<typename Policy>
|
||||
struct EvalEWiseBase : public Metric {
|
||||
EvalEWiseBase() : policy_{}, reducer_{policy_} {}
|
||||
EvalEWiseBase() = default;
|
||||
explicit EvalEWiseBase(char const* policy_param) :
|
||||
policy_{policy_param}, reducer_{policy_} {}
|
||||
|
||||
@@ -351,8 +351,7 @@ struct EvalEWiseBase : public Metric {
|
||||
|
||||
private:
|
||||
Policy policy_;
|
||||
|
||||
ElementWiseMetricsReduction<Policy> reducer_;
|
||||
ElementWiseMetricsReduction<Policy> reducer_{policy_};
|
||||
};
|
||||
|
||||
XGBOOST_REGISTER_METRIC(RMSE, "rmse")
|
||||
|
||||
@@ -62,11 +62,11 @@ struct EvalRankConfig {
|
||||
};
|
||||
|
||||
class PackedReduceResult {
|
||||
double residue_sum_;
|
||||
double weights_sum_;
|
||||
double residue_sum_ { 0 };
|
||||
double weights_sum_ { 0 };
|
||||
|
||||
public:
|
||||
XGBOOST_DEVICE PackedReduceResult() : residue_sum_{0}, weights_sum_{0} {}
|
||||
XGBOOST_DEVICE PackedReduceResult() {} // NOLINT
|
||||
XGBOOST_DEVICE PackedReduceResult(double residue, double weight)
|
||||
: residue_sum_{residue}, weights_sum_{weight} {}
|
||||
|
||||
|
||||
@@ -135,7 +135,6 @@ struct EvalNDCGGpu {
|
||||
dh::caching_device_vector<double> &dcgs(*dcgptr);
|
||||
// Group info on device
|
||||
const auto &dgroups = pred_sorter.GetGroupsSpan();
|
||||
const auto ngroups = pred_sorter.GetNumGroups();
|
||||
const auto &dgroup_idx = pred_sorter.GetGroupSegmentsSpan();
|
||||
|
||||
// First, determine non zero labels in the dataset individually
|
||||
|
||||
@@ -40,11 +40,11 @@ struct EvalAFT : public Metric {
|
||||
void SaveConfig(Json* p_out) const override {
|
||||
auto& out = *p_out;
|
||||
out["name"] = String(this->Name());
|
||||
out["aft_loss_param"] = toJson(param_);
|
||||
out["aft_loss_param"] = ToJson(param_);
|
||||
}
|
||||
|
||||
void LoadConfig(Json const& in) override {
|
||||
fromJson(in["aft_loss_param"], ¶m_);
|
||||
FromJson(in["aft_loss_param"], ¶m_);
|
||||
}
|
||||
|
||||
bst_float Eval(const HostDeviceVector<bst_float> &preds,
|
||||
|
||||
Reference in New Issue
Block a user