MCPcopy Create free account
hub / github.com/dmlc/xgboost / CheckConfigReloadImpl

Function CheckConfigReloadImpl

tests/cpp/helpers.cc:139–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139xgboost::Json CheckConfigReloadImpl(xgboost::Configurable* const configurable, std::string name) {
140 xgboost::Json config_0{xgboost::Object()};
141 configurable->SaveConfig(&config_0);
142 configurable->LoadConfig(config_0);
143
144 xgboost::Json config_1{xgboost::Object()};
145 configurable->SaveConfig(&config_1);
146
147 std::string str_0, str_1;
148 xgboost::Json::Dump(config_0, &str_0);
149 xgboost::Json::Dump(config_1, &str_1);
150 EXPECT_EQ(str_0, str_1);
151
152 if (name != "") {
153 EXPECT_EQ(xgboost::get<xgboost::String>(config_1["name"]), name);
154 }
155 return config_1;
156}
157
158void CheckRankingObjFunction(std::unique_ptr<xgboost::ObjFunction> const& obj,
159 std::vector<xgboost::bst_float> preds,

Callers 1

CheckConfigReloadFunction · 0.85

Calls 2

SaveConfigMethod · 0.45
LoadConfigMethod · 0.45

Tested by

no test coverage detected