-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
Explicitly import distributions from torch #3333
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 like having explicit imports. If a distribution gets renamed or a new distribution gets added maybe we can try to mitigate it by putting try/except
guards to work around import errors?
@ordabayevy Great, I've added |
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.
Looks great!
We just ran into this; gentle suggestion to cut a patch release with this commit. |
Addresses #3332 #2550
This attempts to resolve mypy attribute undefined errors for
dist.Normal
and others. After these fixes, I am able to use VS Code to (1) hover overdist.Normal
to read docs, and (2) detect type errors in e.g.dist.Abnormal
.--config-settings editable_mode=strict
tomake install
which helps mypypy.typed
topackage_data
for setuptools<69__all__
in pyro.distributions.torch__all__
in pyro.distributionsmake format
with the latestblack
Answer: No, since we're using both
import *
andtry...except
around explicit imports.