Skip to content

Commit

Permalink
set is_linear_ to false when it is absent from the model file (fix #3778
Browse files Browse the repository at this point in the history
)
  • Loading branch information
shiyu1994 committed Mar 9, 2021
1 parent 3a5e3c0 commit e9f9934
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/io/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,8 @@ Tree::Tree(const char* str, size_t* used_len) {
int is_linear_int;
Common::Atoi(key_vals["is_linear"].c_str(), &is_linear_int);
is_linear_ = static_cast<bool>(is_linear_int);
} else {
is_linear_ = false;
}

if ((num_leaves_ <= 1) && !is_linear_) {
Expand Down

0 comments on commit e9f9934

Please sign in to comment.