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

support ExpandedDistribution for jax backend #419

Merged
merged 2 commits into from
Jan 10, 2021

Conversation

fehiepsi
Copy link
Member

@fehiepsi fehiepsi commented Jan 9, 2021

Follow up #418.

Though we can eagerly expand distributions, as in https://github.com/pyro-ppl/numpyro/pull/809/files, it might be better to not have to think about doing so each time we want to use funsor. :D

if get_backend() == "jax":
_expanded_dist_path = "backend_dist.ExpandedDistribution"
elif get_backend() == "torch":
_expanded_dist_path = "backend_dist.torch_distribution.ExpandedDistribution"
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you need to define a dummy value of _expanded_dist_path when get_backend() == "numpy" to get test collection to work, even though the tests themselves are all skipped.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Eli!

@eb8680 eb8680 merged commit 6d8f9d7 into pyro-ppl:master Jan 10, 2021
@eb8680 eb8680 mentioned this pull request Jan 14, 2021
34 tasks
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