Skip to content

Add Sphinx docs#350

Merged
apaszke merged 1 commit intopytorch:masterfrom
colesbury:docs
Dec 27, 2016
Merged

Add Sphinx docs#350
apaszke merged 1 commit intopytorch:masterfrom
colesbury:docs

Conversation

@colesbury
Copy link
Member

@colesbury colesbury commented Dec 24, 2016

I've started adding sphix docs. You can build the documentation with:

cd docs
pip install -r requirements.txt
make clean html

There's still a bunch of work to do, including porting over much of the existing documentation, but if you want to get started on documenting the C torch.xxx functions they're listed in torch/docs.py.

We're using Google style Python docstrings because they tend to be nicer to read then pure reStructuredText:

http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html

Also worth reading is the Python docstring convention:

https://www.python.org/dev/peps/pep-0257/

  • For C-implemented functions put the type signature as the first line. (Don't do this for python implemented functions)
  • Use triple quotes

Last, a tidbits from Documenting Python:

7.2.5. Economy of Expression
More documentation is not necessarily better documentation. Err on the side of being succinct.
It is an unfortunate fact that making documentation longer can be an impediment to understanding and can result in even more ways to misread or misinterpret the text. Long descriptions full of corner cases and caveats can create the impression that a function is more complex or harder to use than it actually is.

Copy link
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to keep compiled docs in the repo? Is there any reason to keep the old docs around?

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@apaszke apaszke closed this Dec 27, 2016
@apaszke apaszke reopened this Dec 27, 2016
@colesbury
Copy link
Member Author

I've kept everything as-is the old docs (but moved to docs-old) because it has a bunch of documentation written by @soumith which I haven't ported over yet. Seems easier than trying to access deleted files from the git history. Once the documentation is in good order we should delete docs-old.

I don't think there's any compiled docs in the new docs folder.

@apaszke
Copy link
Contributor

apaszke commented Dec 27, 2016

Ah, autofunction means that Sphinx should generate an entry from docstrings, right?

@colesbury
Copy link
Member Author

Yeah, exactly. There's also automodule and autoclass. The module and class ones have support for auto-including all members, but then you don't have as much control over the ordering (which I think we'll want to do for torch.xxx)

@apaszke apaszke merged commit 126a1cc into pytorch:master Dec 27, 2016
@colesbury colesbury deleted the docs branch December 28, 2016 21:30
jjsjann123 pushed a commit to jjsjann123/pytorch that referenced this pull request Sep 23, 2020
This is the basis Doxygen scaffolding. To build the html documentation, first install doxygen, then:

cd torch/csrc/jit/codegen/cuda/docs
doxygen fuser.doxygen
jjsjann123 pushed a commit to jjsjann123/pytorch that referenced this pull request Sep 24, 2020
This is the basis Doxygen scaffolding. To build the html documentation, first install doxygen, then:

cd torch/csrc/jit/codegen/cuda/docs
doxygen fuser.doxygen
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

Successfully merging this pull request may close these issues.

2 participants