pytorch/docs/source
Ralf Gommers 6cfd7c3811 Remove type annotations from signatures in html docs (#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`:

![image](https://user-images.githubusercontent.com/98330/102010280-77f86900-3d3d-11eb-8f83-e7ee0991ed92.png)

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:

![image](https://user-images.githubusercontent.com/98330/102010304-91011a00-3d3d-11eb-860d-ffa174b4d43b.png)

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 gh-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: https://github.com/pytorch/pytorch/pull/49294

Reviewed By: glaringlee

Differential Revision: D25535272

Pulled By: ezyang

fbshipit-source-id: 5017abfea941a7ae8c4595a0d2bdf8ae8965f0c4
2020-12-14 12:19:48 -08:00
..
_static Add a CONTRIBUTING.md for the distributed package. (#44224) 2020-09-10 14:58:00 -07:00
_templates Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
_templates-stable Add layout.html to template for stable docs (#33770) 2020-03-04 03:14:52 -08:00
community update persons of interest (#45803) 2020-10-05 21:28:00 -07:00
notes Remove deprecated spectral ops from torch namespace (#48594) 2020-12-05 04:12:32 -08:00
rpc Small documentation changes for RRef and Dist Autograd (#48123) 2020-11-18 10:57:59 -08:00
scripts Optimize SiLU (Swish) op in PyTorch (#42976) 2020-08-16 13:21:57 -07:00
__config__.rst Fix __config__ docs (#48557) 2020-11-29 23:57:06 -08:00
amp.rst Reference amp tutorial (recipe) from core amp docs (#44725) 2020-09-16 11:37:58 -07:00
autograd.rst Update docs feature classifications (#39966) 2020-06-24 15:35:59 -07:00
backends.rst Mention TF32 on related docs (#44690) 2020-09-16 19:18:30 -07:00
benchmark_utils.rst expose Timer docs to PyTorch website. (#46880) 2020-11-02 21:59:29 -08:00
bottleneck.rst
checkpoint.rst
complex_numbers.rst Doc note for complex (#41252) 2020-07-16 08:53:27 -07:00
conf.py Remove type annotations from signatures in html docs (#49294) 2020-12-14 12:19:48 -08:00
cpp_extension.rst correct some cpp extension code usages and documents (#39766) 2020-06-10 08:31:22 -07:00
cpp_index.rst Add C++ Landing Page (#38450) 2020-05-14 16:02:01 -07:00
cuda.rst Fix most documentation warnings (#27782) 2019-10-13 10:34:01 -07:00
cudnn_persistent_rnn.rst Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
cudnn_rnn_determinism.rst [doc] Add LSTM non-deterministic workaround (#40893) 2020-07-21 16:20:02 -07:00
data.rst Adding information how to control randomness with DataLoader (#45749) 2020-10-12 16:57:58 -07:00
distributed.rst Add object-based collective APIs to public docs (#48909) 2020-12-07 14:30:25 -08:00
distributions.rst Implement Kumaraswamy Distribution (#48285) 2020-12-02 07:46:45 -08:00
dlpack.rst
docutils.conf Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00
fft.rst Remove deprecated spectral ops from torch namespace (#48594) 2020-12-05 04:12:32 -08:00
futures.rst [JIT x RPC] Consolidate Future type class and Future impl class (#40406) 2020-06-24 01:44:49 -07:00
hub.rst Add a torch.hub.load_local() function that can load models from any local directory with a hubconf.py (#44204) 2020-09-21 14:17:21 -07:00
index.rst Add documentation for torch.overrides submodule. (#48170) 2020-11-30 11:25:31 -08:00
jit_builtin_functions.rst Fix builtin function reference (#24056) 2019-08-09 15:58:15 -07:00
jit_language_reference.rst [JIT] Update docs for recently added features (#45232) 2020-09-28 18:17:42 -07:00
jit_python_reference.rst [JIT] Add support for with statements (#34705) 2020-06-18 16:57:18 -07:00
jit_unsupported.rst [JIT] Update docs for recently added features (#45232) 2020-09-28 18:17:42 -07:00
jit.rst Fix jit doc model loading example (#48104) 2020-12-03 20:47:20 -08:00
linalg.rst Added entry for torch.linalg.cond to linalg.rst (#48941) 2020-12-07 19:01:05 -08:00
math-quantizer-equation.png adding quantization.rst file for quantization feature (#27559) 2019-10-09 16:45:09 -07:00
mobile_optimizer.rst optimize_for_mobile: bring packed params to root module (#42740) 2020-08-08 15:53:20 -07:00
model_zoo.rst
multiprocessing.rst Update docs for master to remove Python 2 references (#36336) 2020-04-16 10:15:48 -07:00
name_inference.rst Fixed median nan propagation and implemented nanmedian (#45847) 2020-10-08 11:20:21 -07:00
named_tensor.rst Easier english updated tech docs (#42016) 2020-07-24 14:36:17 -07:00
nn.functional.rst [pytorch] Add triplet margin loss with custom distance (#43680) 2020-09-22 11:35:52 -07:00
nn.init.rst Bag of documentation fixes; fix more sphinx warnings (#27850) 2019-10-15 07:31:14 -07:00
nn.rst Add LazyConvXd and LazyConvTransposeXd (#47350) 2020-12-01 07:00:28 -08:00
onnx.rst [ONNX] Changes to export API to better handle named arguments (#47367) 2020-12-10 12:31:00 -08:00
optim.rst Update optim.rst for better understanding (#45944) 2020-10-14 09:36:06 -07:00
quantization-support.rst [reland][quant] Remove nn.quantized.ReLU module and nn.quantized.functional.relu (#47415) (#48038) 2020-11-17 09:52:21 -08:00
quantization.rst [docs] Changing the wording on quantization versioning and support (#46858) 2020-10-26 14:30:50 -07:00
random.rst Remove duplicated entries in random.rst (#39725) 2020-06-10 16:51:15 -07:00
rpc.rst Update docs for RPC async_execution (#45458) 2020-09-28 20:48:12 -07:00
sparse.rst Revised sparse tensor documentation. (#45400) 2020-10-22 02:07:54 -07:00
storage.rst
tensor_attributes.rst Update docs feature classifications (#39966) 2020-06-24 15:35:59 -07:00
tensor_view.rst Add torch.swapdims and torch.swapaxes (#46041) 2020-11-18 11:35:53 -08:00
tensorboard.rst Add method add_hparams to API doc (#27344) 2019-10-03 17:07:45 -07:00
tensors.rst Remove deprecated spectral ops from torch namespace (#48594) 2020-12-05 04:12:32 -08:00
torch.nn.intrinsic.qat.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.intrinsic.quantized.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.intrinsic.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.qat.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.quantized.dynamic.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.nn.quantized.rst [reland][quant] Remove nn.quantized.ReLU module and nn.quantized.functional.relu (#47415) (#48038) 2020-11-17 09:52:21 -08:00
torch.overrides.rst Add documentation for torch.overrides submodule. (#48170) 2020-11-30 11:25:31 -08:00
torch.quantization.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00
torch.rst Remove deprecated spectral ops from torch namespace (#48594) 2020-12-05 04:12:32 -08:00
type_info.rst DOC: split quantization.rst into smaller pieces (#41321) 2020-07-25 23:59:40 -07:00