-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autogenerate parameter types in documentation from python typehints.
For example: if the method is... ```python def forward(self, x1: Tensor, x2: Optional[Tensor]) -> Union[Tensor, LinearOperator]: r""" Does the forward thing. :param x1: The x1 arg :param x2: The x2 arg :return: The forward stuff. """ # ... ``` The resulting documentation will include the appropriate types: ``` Parameters: - x1 (torch.Tensor) - The x1 arg - x2 (torch.Tensor, optional) - The x2 arg Return type: torch.Tensor or LinearOperator Returns: The forward stuff. ``` This (hopefully) should prevent a lot of duplicate effort on our end. This commit also refactors the gpytorch.kernels.Kernel and gpytorch.distributions.MultivariateNormal docs to utilize auto-typing.
- Loading branch information
Showing
6 changed files
with
459 additions
and
211 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ ipython | |
ipykernel | ||
sphinx | ||
sphinx_rtd_theme | ||
sphinx_autodoc_typehints | ||
nbsphinx | ||
m2r2 | ||
pyro-ppl |
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.