Pytorch

Pytorch官方入门教程

2019-03-16  本文已影响1772人  Lornatang
Pytorch

PyTorch Tutorials

All the tutorials are now presented as sphinx style documentation at:

https://github.com/lornatang/pytorch/tutorials/

Contributing

We use sphinx-gallery's notebook styled examples to create the tutorials. Syntax is very simple. In essence, you write a slightly well formatted python file and it shows up as documentation page.

Here's how to create a new tutorial:

  1. Create a notebook styled python file. If you want it executed while inserted into documentation, save the file with suffix tutorial so that file name is your_tutorial.py.
  2. Put it in one of the beginner_source, intermediate_source, advanced_source based on the level.
  3. Include it in the right TOC tree at index.rst
  4. Create a thumbnail in the index file using a command like .. galleryitem:: beginner/your_tutorial.py. (This is a custom directive. See custom_directives.py for more info.)

In case you prefer to write your tutorial in jupyter, you can use this script to convert the notebook to python file. After conversion and addition to the project, please make sure the sections headings etc are in logical order.

Building

If you want to use virtualenv, make your environment in a venv directory like: virtualenv ./venv, then source ./venv/bin/activate.

上一篇下一篇

猜你喜欢

热点阅读