Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Addresses #50496 This fixes a number of inconsistencies in torch.distributions.constraints as used for parameters and supports of probability distributions. - Adds a `constraints.independent` and replaces `real_vector` with `independent(real, 1)`. (this pattern has long been used in Pyro) - Adds an `.event_dim` attribute to all constraints. - Tests that `constraint.check(data)` has the correct shape. (Previously the shapes were incorrect). - Adds machinery to set static `.is_discrete` and `.event_dim` for `constraints.dependent`. - Fixes constraints for a number of distributions. ## Tested - added a new check to the constraints tests - added a new check for `.event_dim` cc fehiepsi feynmanliang stefanwebb Pull Request resolved: #50547 Reviewed By: VitalyFedyunin Differential Revision: D25918330 Pulled By: neerajprad fbshipit-source-id: a648c3de3e8704f70f445c0f1c39f2593c8c74db
- Loading branch information
1 parent
5016637
commit 21c2542
Showing
11 changed files
with
162 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.