Skip to content

Commit

Permalink
cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jan 20, 2025
1 parent 1f4a51a commit ff2cc9b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions jvm-packages/xgboost4j/src/native/xgboost4j-gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ class DataIteratorProxy {
labels_.emplace_back(std::make_unique<dh::device_vector<float>>());
CopyMetaInfo(&label, labels_.back().get(), copy_stream_);
label_interfaces_.emplace_back(label);

proxy_.SetInfo(Symbols::kLabel, label);

it = json_map.find(Symbols::kWeight);
Expand Down Expand Up @@ -397,7 +396,7 @@ class DataIteratorProxy {
}
return NextSecondLoop();
}
};
}
};

// An iterator proxy for external memory.
Expand Down Expand Up @@ -425,23 +424,23 @@ class ExternalMemoryIteratorProxy {
if (json_map.find(Symbols::kLabel) == json_map.cend()) {
LOG(FATAL) << "Must have a label field.";
}
Json label = json_interface["label"];
Json label = json_interface[Symbols::kLabel.c_str()];
CHECK(!IsA<Null>(label));
proxy_.SetInfo(Symbols::kLabel, label);

if (json_map.find("weight") != json_map.cend()) {
Json weight = json_interface["weight"];
if (json_map.find(Symbols::kWeight) != json_map.cend()) {
Json weight = json_interface[Symbols::kWeight.c_str()];
CHECK(!IsA<Null>(weight));
proxy_.SetInfo(Symbols::kWeight, weight);
}

if (json_map.find("baseMargin") != json_map.cend()) {
Json basemargin = json_interface["baseMargin"];
if (json_map.find(Symbols::kBaseMargin) != json_map.cend()) {
Json basemargin = json_interface[Symbols::kBaseMargin.c_str()];
proxy_.SetInfo("base_margin", basemargin);
}

if (json_map.find("qid") != json_map.cend()) {
Json qid = json_interface["qid"];
if (json_map.find(Symbols::kQid) != json_map.cend()) {
Json qid = json_interface[Symbols::kQid.c_str()];
proxy_.SetInfo(Symbols::kQid, qid);
}
}
Expand Down

0 comments on commit ff2cc9b

Please sign in to comment.