Use `UpdateAllowUnknown' for non-model related parameter. (#4961)
* Use `UpdateAllowUnknown' for non-model related parameter. Model parameter can not pack an additional boolean value due to binary IO format. This commit deals only with non-model related parameter configuration. * Add tidy command line arg for use-dmlc-gtest.
This commit is contained in:
@@ -11,7 +11,7 @@ TEST(GBTree, SelectTreeMethod) {
|
||||
size_t constexpr kCols = 10;
|
||||
|
||||
GenericParameter generic_param;
|
||||
generic_param.InitAllowUnknown(Args{});
|
||||
generic_param.UpdateAllowUnknown(Args{});
|
||||
std::unique_ptr<GradientBooster> p_gbm{
|
||||
GradientBooster::Create("gbtree", &generic_param, {}, 0)};
|
||||
auto& gbtree = dynamic_cast<gbm::GBTree&> (*p_gbm);
|
||||
@@ -36,7 +36,7 @@ TEST(GBTree, SelectTreeMethod) {
|
||||
ASSERT_EQ(tparam.predictor, "cpu_predictor");
|
||||
|
||||
#ifdef XGBOOST_USE_CUDA
|
||||
generic_param.InitAllowUnknown(Args{{"gpu_id", "0"}});
|
||||
generic_param.UpdateAllowUnknown(Args{{"gpu_id", "0"}});
|
||||
gbtree.Configure({{"tree_method", "gpu_hist"}, {"num_feature", n_feat}});
|
||||
ASSERT_EQ(tparam.updater_seq, "grow_gpu_hist");
|
||||
ASSERT_EQ(tparam.predictor, "gpu_predictor");
|
||||
@@ -64,7 +64,7 @@ TEST(GBTree, ChoosePredictor) {
|
||||
std::string n_feat = std::to_string(kCols);
|
||||
Args args {{"tree_method", "approx"}, {"num_feature", n_feat}};
|
||||
GenericParameter generic_param;
|
||||
generic_param.InitAllowUnknown(Args{{"gpu_id", "0"}});
|
||||
generic_param.UpdateAllowUnknown(Args{{"gpu_id", "0"}});
|
||||
|
||||
auto& data = (*(p_mat->GetBatches<SparsePage>().begin())).data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user