-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Breaking] Remove dmlc::Parameter #293
Conversation
Codecov Report
@@ Coverage Diff @@
## mainline #293 +/- ##
==============================================
- Coverage 84.78% 83.99% -0.79%
Complexity 46 46
==============================================
Files 101 102 +1
Lines 7899 7909 +10
Branches 50 50
==============================================
- Hits 6697 6643 -54
- Misses 1177 1241 +64
Partials 25 25
Continue to review full report at Codecov.
|
_check_call(_LIB.TreeliteCompilerGenerateCode( | ||
if verbose and _params: | ||
_params['verbose'] = 1 | ||
params_json_str = json.dumps(_params) if _params else '{}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think JSON handles this automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the None object gets serialized to null
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, the param is optional.
Extracted from #285.
dmlc/parameter.h
.CompilerParam
no longer inherits fromdmlc::Parameter
. Consequently, it now implements a special methodParseFromJSON()
that ingests parameters from a JSON string.Before:
After:
TreeliteCompilerCreate
andTreeliteCompilerGenerateCode
are renamed toTreeliteCompilerCreateV2
andTreeliteCompilerGenerateCodeV2
, respectively, to indicate the different calling signature. In addition,TreeliteCompilerSetParam
has been removed.ParseFromJSON()
.