Pyi doc inclusion + fix (#117267)

Reland of https://github.com/pytorch/pytorch/pull/114705 with extra fix to smoothly handle when the modules we're trying to load are not available (and thus the pyi won't contain the docs in this case).

Tested locally that it works properly in fbcode.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/117267
Approved by: https://github.com/ezyang
This commit is contained in:
albanD
2024-01-15 13:06:49 +00:00
committed by PyTorch MergeBot
parent 7a851fedc8
commit 75818adcf7
3 changed files with 57 additions and 2 deletions

View File

@ -2,7 +2,7 @@
import torch._C
from torch._C import _add_docstr as add_docstr
from ._torch_docs import parse_kwargs, reproducibility_notes
from torch._torch_docs import parse_kwargs, reproducibility_notes
def add_docstr_all(method, docstr):