-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Fix deeplab #1508
Fix deeplab #1508
Conversation
|
||
def forward(self, x): | ||
size = x.shape[-2:] | ||
x = super(ASPPPooling, self).forward(x) | ||
# workaround while torchscript doesn't support overriding forward in nn.Sequential | ||
x = getattr(self, '0')(x) |
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.
does self.0
not work here instead ? TorchScript doesn't support getattr
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.
self.0
is an invalid syntax in python unfortunately.
This is weird, because I tried compiling this code and running it, and it seemed to work fine and give the same result as the non-compiled version
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.
This looks pretty hacky :-)
Let me take a look at supporting sequentials with custom forwards in Torchscript and report back. |
Subsumed by #1575 |
Alternative implementation to #1436
@eellison let me know if you think this could work. I've tried it locally and it seems to be ok.