joddiy commented on issue #691:
URL: https://github.com/apache/singa/issues/691#issuecomment-629610072


   > To be consistent, I think we'd better always call `m.compile()` explicitly?
   > 
   > ```python
   > m=MyModel()
   > m.compile([x], use_graph=True)
   > m.load_states(fpath)
   > 
   > m=MyONNXModel(onnx_model)
   > m.compile([x], use_graph=True)
   > 
   > m=singa.load(fpath)
   > m.compile([x], use_graph=True)
   > ```
   > 
   > Then the `load_states()` only has a single argument, i.e., fpath.
   > 
   > Any better solution?
   
   Actually, in the above sonnx API, we merge load_states into compile, right?
   How about this one:
   
   ```
   m=MyModel(path) # check the file is a model or just states
   m.compile([x], use_graph=True) # do m.load_states(fpath) within compile
   
   m=MyONNXModel(onnx_model)
   m.compile([x], use_graph=True)
   
   m=singa.load(fpath)
   m.compile([x], use_graph=True)
   ```


----------------------------------------------------------------
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]


Reply via email to