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

Method Copy

src/learner.cc:283–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283void LearnerModelParam::Copy(LearnerModelParam const& that) {
284 base_score_.Reshape(that.base_score_.Shape());
285 base_score_.Data()->SetDevice(that.base_score_.Device());
286 base_score_.Data()->Copy(*that.base_score_.Data());
287 std::as_const(base_score_).HostView();
288 if (!that.base_score_.Device().IsCPU()) {
289 std::as_const(base_score_).View(that.base_score_.Device());
290 }
291 CHECK_EQ(base_score_.Data()->DeviceCanRead(), that.base_score_.Data()->DeviceCanRead());
292 CHECK(base_score_.Data()->HostCanRead());
293
294 num_feature = that.num_feature;
295 num_output_group = that.num_output_group;
296 task = that.task;
297 multi_strategy = that.multi_strategy;
298}
299
300struct LearnerTrainParam : public XGBoostParameter<LearnerTrainParam> {
301 // flag to disable default metric

Callers 10

SliceMethod · 0.45
EvalOneIterMethod · 0.45
PredictMethod · 0.45
GetMultiMetricEvalFunction · 0.45
ArrayIterForTestMethod · 0.45
GenerateRandomGradientsFunction · 0.45
TESTFunction · 0.45
TestInplacePredictionFunction · 0.45
LoadGBTreeModelFunction · 0.45
TESTFunction · 0.45

Calls 10

ReshapeMethod · 0.80
ShapeMethod · 0.80
SetDeviceMethod · 0.45
DataMethod · 0.45
DeviceMethod · 0.45
HostViewMethod · 0.45
IsCPUMethod · 0.45
ViewMethod · 0.45
DeviceCanReadMethod · 0.45
HostCanReadMethod · 0.45

Tested by 4

TESTFunction · 0.36
TestInplacePredictionFunction · 0.36
LoadGBTreeModelFunction · 0.36
TESTFunction · 0.36