-
Notifications
You must be signed in to change notification settings - Fork 241
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
Revise the exporters API #43
Conversation
m2cgen/exporters.py
Outdated
return assembler_cls | ||
def _export(model, interpreter): | ||
model_name = type(model).__name__ | ||
assembler_cls = _get_assembler_cls(model_name) |
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 know it's probably my code, but maybe move logic of building model_name
into _get_assembler_cls
function?
@@ -45,9 +45,7 @@ def interpret(self, expr): | |||
os.path.dirname(__file__), "linear_algebra.java") | |||
top_cg.add_code_lines(utils.get_file_content(filename)) | |||
|
|||
return [ | |||
(self.model_name, top_cg.code), | |||
] |
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.
Nice!!
tests/e2e/executors/java.py
Outdated
for model_name, code in self.exporter.export(): | ||
file_name = os.path.join(self._resource_tmp_dir, | ||
"{}.java".format(model_name)) | ||
model_name = "Model" |
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.
Maybe move it to the class level and reuse in predict()
method?
No description provided.