-
Notifications
You must be signed in to change notification settings - Fork 129
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
[JIT] Add TorchScript Compatibility for ANIModel and Ensemble #307
Conversation
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 the problem comes from the definition of Sequential
: When JIT is trying to compile the code for Sequential
, it assumes that the input of Sequential.forward
is a Tensor
. I think we should eventually remove Sequential, but write our own class with correct type annotation of forward
instead. But for now, this PR, why not just
self.model_iterator = torch.jit.script(self.model_iterator)
self.ensemble = torch.nn.Sequential(self.aev_computer, self.model_iterator)
Instead of
self.ensemble = torch.nn.Sequential(self.aev_computer, self.model_iterator)
self.ensemble = torch.jit.script(self.ensemble)
and leave the problem of Sequencial
to fix it in later PR?
Problem with type annotation shows up every where |
@farhadrgh Should be working |
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.
@farhadrgh I am giving out approval. If it also looks good to you, then please merge.
Looks good, thanks |
This PR fixes one of the items in #305