Fix multiline signatures in docstring (#38768)
Summary:
Fix https://github.com/pytorch/pytorch/issues/38694
See https://5533621-65600975-gh.circle-artifacts.com/0/docs/torch.html
## Index Page
| Before | After |
| --- | --- |
|  |  |
|  |  |
## Detail Page
| Before | After |
| --- | --- |
|  |  |
|  |  |  |
|  |  |
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38768
Differential Revision: D21691859
Pulled By: zou3519
fbshipit-source-id: 336158be450436554a1fa2105a5eedf24236c56b
diff --git a/torch/_torch_docs.py b/torch/_torch_docs.py
index 03cad7c..9ed572c 100644
--- a/torch/_torch_docs.py
+++ b/torch/_torch_docs.py
@@ -4686,9 +4686,9 @@
""".format(**factory_like_common_args))
add_docstr(torch.randint,
- r"""
-randint(low=0, high, size, \*, generator=None, out=None, \
- dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor
+ """
+randint(low=0, high, size, \\*, generator=None, out=None, \
+dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor
Returns a tensor filled with random integers generated uniformly
between :attr:`low` (inclusive) and :attr:`high` (exclusive).
@@ -4729,8 +4729,8 @@
""".format(**factory_common_args))
add_docstr(torch.randint_like,
- r"""
-randint_like(input, low=0, high, dtype=None, layout=torch.strided, device=None, requires_grad=False,
+ """
+randint_like(input, low=0, high, dtype=None, layout=torch.strided, device=None, requires_grad=False, \
memory_format=torch.preserve_format) -> Tensor
Returns a tensor with the same shape as Tensor :attr:`input` filled with
@@ -6689,8 +6689,8 @@
""".format(**factory_common_args))
add_docstr(torch.full_like,
- r"""
-full_like(input, fill_value, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False,
+ """
+full_like(input, fill_value, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False, \
memory_format=torch.preserve_format) -> Tensor
Returns a tensor with the same size as :attr:`input` filled with :attr:`fill_value`.