Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple inheritance in torch.distributions (#16772)
Summary: This adds calls to `super().__init__()` in three classes in torch.distributions. This is needed when `Distribution` and `Transform` objects are used with multiple inheritance, as e.g. combined with `torch.nn.Module`s. For example ```py class MyModule(torch.distributions.Transform, torch.nn.Module): ... ``` cc martinjankowiak esling who have wanted to use this pattern, e.g. in #16756 Pull Request resolved: #16772 Differential Revision: D13978633 Pulled By: soumith fbshipit-source-id: 8bc6cca1747cd74d32135ee2fe588bba2ea796f1
- Loading branch information
1 parent
2681af1
commit 0d366e1
Showing
3 changed files
with
3 additions
and
0 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