XJDKC commented on a change in pull request #684:
URL: https://github.com/apache/singa/pull/684#discussion_r416846262
##########
File path: python/singa/sonnx.py
##########
@@ -2135,6 +2084,81 @@ def run(self, inputs, **kwargs):
return [ret_outputs[outp] for outp in final_outputs]
+class BaseModel(module.Module):
+
+ def __init__(self, sg_ir, loss, optimizer):
+ """
+ Init a SIGNA Module
+ Args:
+ sg_ir: a SingaRep class
+ """
+ super(BaseModel, self).__init__()
+ self.optimizer = optimizer
+ self.loss = loss
Review comment:
Please change the name of this member variable. Since loss is already
the name of a member function, this assignment will rewrite the original
function. So the loss function is not wrapped by the
decorator(buffer_operation) which will cause a new operation to be created in
each iteration.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]