Pass obj info by reference instead of by value. (#8889)

- Pass obj info into tree updater as const pointer.

This way we don't have to initialize the learner model param before configuring gbm, hence
breaking up the dependency of configurations.
This commit is contained in:
Jiaming Yuan
2023-03-11 01:38:28 +08:00
committed by GitHub
parent 54e001bbf4
commit 6deaec8027
18 changed files with 125 additions and 112 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2014-2013 by XBGoost Contributors
* Copyright 2014-2023 by XBGoost Contributors
* \file updater_sync.cc
* \brief synchronize the tree in all distributed nodes
*/
@@ -53,5 +53,5 @@ class TreeSyncher : public TreeUpdater {
XGBOOST_REGISTER_TREE_UPDATER(TreeSyncher, "sync")
.describe("Syncher that synchronize the tree in all distributed nodes.")
.set_body([](Context const* ctx, ObjInfo) { return new TreeSyncher(ctx); });
.set_body([](Context const* ctx, auto) { return new TreeSyncher(ctx); });
} // namespace xgboost::tree