Skip to content

Commit

Permalink
Polish.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Nov 10, 2021
1 parent 1541bfd commit 942fa53
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
5 changes: 1 addition & 4 deletions python-package/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ description-file = README.rst
[mypy]
ignore_missing_imports = True
disallow_untyped_defs = True
follow_imports = silent

[flake8]
max-line-length=90
follow_imports = silent
3 changes: 2 additions & 1 deletion src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ XGB_DLL int XGDMatrixSetInfoFromInterface(DMatrixHandle handle,
char const* interface_c_str) {
API_BEGIN();
CHECK_HANDLE();
static_cast<std::shared_ptr<DMatrix> *>(handle)->get()->Info().SetInfo(field, interface_c_str);
static_cast<std::shared_ptr<DMatrix>*>(handle)
->get()->Info().SetInfo(field, interface_c_str);
API_END();
}

Expand Down
2 changes: 1 addition & 1 deletion src/data/array_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ class ArrayInterface {
void *data;
// Total number of items
size_t n;
// Whether the memory is contiguous
// Whether the memory is c-contiguous
bool is_contiguous {false};
// RTTI
ArrayInterfaceHandler::Type type;
Expand Down
2 changes: 1 addition & 1 deletion src/data/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ inline void ValidateQueryGroup(std::vector<bst_group_t> const &group_ptr_) {
bool valid_query_group = true;
for (size_t i = 1; i < group_ptr_.size(); ++i) {
valid_query_group = valid_query_group && group_ptr_[i] >= group_ptr_[i - 1];
if (!valid_query_group) {
if (XGBOOST_EXPECT(!valid_query_group, false)) {
break;
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/gbm/gblinear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,8 @@ class GBLinear : public GradientBooster {
{learner_model_param_->num_feature, n_groups},
GenericParameter::kCpuId};
for (size_t i = 0; i < learner_model_param_->num_feature; ++i) {
auto feature_score = scores.Slice(i, linalg::All());
CHECK_EQ(feature_score.Shape().size(), 1);
for (bst_group_t g = 0; g < n_groups; ++g) {
feature_score(g) = model_[i][g];
scores(i, g) = model_[i][g];
}
}
}
Expand Down

0 comments on commit 942fa53

Please sign in to comment.