Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc.py file was built, but not reflected. #33119

Closed
cold-pumpkin opened this issue Feb 8, 2020 · 1 comment
Closed

doc.py file was built, but not reflected. #33119

cold-pumpkin opened this issue Feb 8, 2020 · 1 comment

Comments

@cold-pumpkin
Copy link

cold-pumpkin commented Feb 8, 2020

Hello. I have question about building documentation files.
I add some codes to _torch_docs.py file to solve the issue no. #29758 and built it.
Build was successful and I got an index.html file in build/html/folder, but the code I wrote was not reflected at all.
I tried a few times but couldn't solve it. Please give me a hand on which part to check.

I'm sorry, but @vishwakftw can you give me some advice?

📚 Documentation

diff --git a/torch/_torch_docs.py b/torch/_torch_docs.py
index 6d968a5191..9f3c06ffdd 100644
--- a/torch/_torch_docs.py
+++ b/torch/_torch_docs.py
@@ -3356,12 +3356,13 @@ Example::

 add_docstr(torch.mean,
            r"""
-.. function:: mean(input) -> Tensor
+.. function:: mean(input, dtype=None) -> Tensor

 Returns the mean  @value of all elements in the :attr:`input` tensor.

 Args:
     {input}
+    {dtype}

 Example::

@@ -3371,7 +3372,7 @@ Example::
     >>> torch.mean(a)
     tensor(0.3367)

-.. function:: mean(input, dim, keepdim=False, out=None) -> Tensor
+.. function:: mean(input, dim, keepdim=False, out=None, dtype=None) -> Tensor

 Returns the mean value of each row of the :attr:`input` tensor in the given
 dimension :attr:`dim`. If :attr:`dim` is a list of dimensions,
@@ -3384,6 +3385,7 @@ Args:
     {dim}
     {keepdim}
     {out}
+    dtype (:class:`torch.dtype`): the desired data type of returned tensor.

 Example::
@cold-pumpkin cold-pumpkin changed the title Doc file was built, but not reflected. doc.py file was built, but not reflected. Feb 8, 2020
@vishwakftw
Copy link
Contributor

I believe you have to rebuild PyTorch from source. The docs are built with the version of PyTorch installed, so if you don’t install PyTorch after making these changes, you won’t be able to see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants