Skip to content
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

Reorganize constraints and transforms modules #2052

Merged
merged 7 commits into from
Oct 3, 2019
Merged

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented Oct 2, 2019

Addresses issues in #2049

This reorganizes the constraints and transforms modules such that:

  • pyro.distributions strictly extends torch.distributions
  • pyro.distributions.constraints strictly extends torch.distributions.constaints
  • pyro.distributions.transforms strictly extends torch.distributions.transforms

This is important for pyro.generic so all constraints and transforms are accessible, both those from PyTorch and those from Pyro.

After this PR we can idiomatically:

import pyro.distributions as dist
from pyro.distributions import constraints, transforms

or more generically, following #2049 ,

from pyro.generic import distributions as dist
from pyro.generic import constraints, transforms

cc @stefanwebb

@fritzo fritzo added this to the 1.0 release milestone Oct 2, 2019
neerajprad
neerajprad previously approved these changes Oct 2, 2019
Copy link
Member

@neerajprad neerajprad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for refactoring this. Will merge when tests pass.

@fritzo fritzo removed the discussion label Oct 3, 2019
@neerajprad neerajprad merged commit 716737d into dev Oct 3, 2019
@fritzo fritzo deleted the reorg-consts-trans branch October 12, 2019 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants