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

Add default TorchDistribution.expand method #2209

Merged
merged 2 commits into from
Dec 5, 2019

Conversation

neerajprad
Copy link
Member

Resolves #2186.

This adds a default .expand method in TorchDistributon by resurrecting the earlier ReshapedDistribution.

Tests: All existing expand tests exercise both the distribution's expand method as well as the default one provided in TorchDistribution, and these pass.

Copy link
Member

@fritzo fritzo left a comment

Choose a reason for hiding this comment

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

Thanks for implementing!

pyro/distributions/torch_distribution.py Outdated Show resolved Hide resolved
pyro/distributions/torch_distribution.py Outdated Show resolved Hide resolved
pyro/distributions/torch_distribution.py Outdated Show resolved Hide resolved
tests/distributions/test_distributions.py Outdated Show resolved Hide resolved
@fritzo fritzo merged commit ab6a88b into pyro-ppl:dev Dec 5, 2019
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.

FR ExpandedDistribution for easier custom distributions
2 participants