Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove type annotations from signatures in html docs (pytorch#49294)
Summary: One unintended side effect of moving type annotations inline was that those annotations now show up in signatures in the html docs. This is more confusing and ugly than it is helpful. An example for `MaxPool1d`:  This makes the docs readable again. The parameter descriptions often already have type information, and there will be many cases where the type annotations will make little sense to the user (e.g., returning typevar T, long unions). Change to `MaxPool1d` example:  Note that once we can build the docs with Sphinx 3 (which is far off right now), we have two options to make better use of the extra type info in the annotations (some of which is useful): - `autodoc_type_aliases`, so we can leave things like large unions unevaluated to keep things readable - `autodoc_typehints = 'description'`, which moves the annotations into the parameter descriptions. Another, more labour-intensive option, is what vadimkantorov suggested in pytorchgh-44964: show annotations on hover. Could also be done with some foldout, or other optional way to make things visible. Would be nice, but requires a Sphinx contribution or plugin first. Pull Request resolved: pytorch#49294 Reviewed By: glaringlee Differential Revision: D25535272 Pulled By: ezyang fbshipit-source-id: 5017abfea941a7ae8c4595a0d2bdf8ae8965f0c4
- Loading branch information