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
) (#4056)
  • Loading branch information
shiyu1994 committed Mar 12, 2021
1 parent e5c3f7e commit ec4bd1e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/io/tree.cpp
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 ec4bd1e

Please sign in to comment.