+5
日增长
9,434
stars
4,459
forks
181
watchers
2,950
prs
1,029
issues
0
releases
README
PyTorch Tutorials All the tutorials are now presented as sphinx style documentation at: https://pytorch.org/tutorials Asking a question If you have a question about a tutorial, post in https://dev-discuss.pytorch.org/ rather than creating an issue in this repo. Your question will be answered much faster on the dev-discuss forum. Submitting an issue You can submit the following types of issues: Feature request - request a new tutorial to be added. Please explain why this tutorial is needed and how it demonstrates PyTorch value. Bug report - report a failure or outdated information in an existing tutorial. When submitting a bug report, please run: python3 -m torch.utils.collect_env to get information about your environment and add the output to the bug report. 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 an HTML page. In addition, a Jupyter notebook is autogenerated and available to run in Google Colab. Here is how you can create a new tutorial (for a detailed description, see CONTRIBUTING.md): NOTE: Before submitting a new tutorial, read PyTorch Tutorial Submission Policy. 1. Create a Python file. If you want it executed while inserted into documentation, save the file with the suffix tutorial so that the file name is your_tutorial.py. 2. Put it in one of the beginner_source, intermediate_source, advanced_source directory based on the level of difficulty. If it is a recipe, add it to recipes_source. For tutorials demonstrating unstable prototype features, add to the prototype_source. 3. For Tutorials (except if it is a prototype feature), include it in the toctree directive and create a customcarditem in index.rst. 4. For Tutorials (except if it is a prototype feature), create a thumbnail in the index.rst file using a command like .. customcarditem:: beginner/your_tutorial.html. For Recipes, create a thumbnail in the recipes_index.rst If you are starting off with a Jupyter notebook, you can use this script to convert the notebook to Python file. After conversion and addition to the project, please make sure that section headings and other things are in logical order. Building locally The tutorial build is very large and requires a GPU. If your machine does not have a GPU device, you can preview your HTML build without actually downloading the data and running the tutorial code: 1. Install required dependencies by running: pip install -r requirements.txt. Typically, you would run either in conda or virtualenv. If you want to use virtualenv, in the root of the repo, run: virtualenv venv, then source venv/bin/activate. - If you have a GPU-powered laptop, you can build using make docs. This will download the data, execute the tutorials and build the documentation to docs/ directory. This might take about 60-120 min for systems with GPUs. If you do not have a GPU installed on your sys
Top issues
#2347💡 [REQUEST] - Tutorial on extending TorchX12 comments · 2023-05-25#2115Can not show the "GPU Summary" panel in the TensorBoard with torch_tb_profiler plugin12 comments · 2022-11-10#1010Tutorial on custom dataloaders (NOT datasets)11 comments · 2020-06-03#1637Distributed Data Parallel Tutorial UX improvement suggestion10 comments · 2021-08-05#3263module 'torch' has no attribute 'accelerator'9 comments · 2025-01-25#2611[BUG]-Network error while importing flava_model_for_classification from torchmultimodal9 comments · 2023-10-19#2340💡 [REQUEST] - How to use TorchServe: Walk through an example9 comments · 2023-05-24#3153AOTI tutorial `CUDA_HOME`8 comments · 2024-11-06
Discussions
#3949[Project Showcase] Disk Sparse Adam (DSA) — A disk-backed SparseAdam for large embeddings and GNNs0 comments · 2026-08-08#3823Deterministic Combinatorial Sharding via Hardware-Accelerated Hardy-Ramanujan-Rademacher Triton Kernels on Blackwell Architectures0 comments · 2026-04-12#3802the first native Pytorch distributed training backend for Apple Silicon0 comments · 2026-03-21#3313Forward Mode AD with Simple MLP0 comments · 2025-04-03#3175Confusing description on custom mutable operators0 comments · 2024-12-06#2770Broken tutorial links0 comments · 2024-02-16#2570how to fix the problem:RuntimeError: Windows not yet supported for torch.compile0 comments · 2023-09-25#2532Custom Datasets Guide Question0 comments · 2023-08-21