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

Distribution flatten/unflatten: Do not sort attrs. #1509

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

hessammehr
Copy link
Contributor

Currently, Distribution.tree_flatten sorts distribution attrs alphabetically, so the order is sometimes different from what is declared in the definition, e.g. the beta distribution Beta(concentration1, concentration0).tree_flatten() = (concentration0, concentration1). With this PR, attrs are used in the same order as declared within Distribution.arg_constraints.

@hessammehr hessammehr force-pushed the HM/consistent_flatten branch from aa0d4e3 to 1a98b08 Compare December 9, 2022 14:49
Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

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

Thanks, @hessammehr!

@fehiepsi fehiepsi merged commit 2b70d7d into pyro-ppl:master Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants