Skip to content

Commit 00ee94e

Browse files
author
Jessica Lin
authored
Merge branch 'master' into cpp_autograd_tutorial
2 parents 85c2a6e + 9e5d67d commit 00ee94e

File tree

6 files changed

+197
-37
lines changed

6 files changed

+197
-37
lines changed

.jenkins/build.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
7676
FILES_TO_RUN+=($(basename $filename .py))
7777
fi
7878
count=$((count+1))
79+
done
80+
for filename in $(find recipes_source/ -name '*.py' -not -path '*/data/*'); do
81+
if [ $(($count % $NUM_WORKERS)) != $WORKER_ID ]; then
82+
echo "Removing runnable code from "$filename
83+
python $DIR/remove_runnable_code.py $filename $filename
84+
else
85+
echo "Keeping "$filename
86+
FILES_TO_RUN+=($(basename $filename .py))
87+
fi
88+
count=$((count+1))
7989
done
8090
echo "FILES_TO_RUN: " ${FILES_TO_RUN[@]}
8191

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161

6262
sphinx_gallery_conf = {
6363
'examples_dirs': ['beginner_source', 'intermediate_source',
64-
'advanced_source'],
65-
'gallery_dirs': ['beginner', 'intermediate', 'advanced'],
64+
'advanced_source', 'recipes_source'],
65+
'gallery_dirs': ['beginner', 'intermediate', 'advanced', 'recipes'],
6666
'filename_pattern': os.environ.get('GALLERY_PATTERN', r'tutorial.py'),
6767
'backreferences_dir': False
6868
}

index.rst

Lines changed: 138 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,6 @@ Image/Video
7676
:figure: /_static/img/dcgan_generator.png
7777
:description: :doc:`beginner/dcgan_faces_tutorial`
7878

79-
.. customgalleryitem::
80-
:tooltip: (experimental) Static Quantization with Eager Mode in PyTorch
81-
:figure: /_static/img/qat.png
82-
:description: :doc:`advanced/static_quantization_tutorial`
83-
84-
.. customgalleryitem::
85-
:tooltip: Perform quantized transfer learning with feature extractor
86-
:description: :doc:`/intermediate/quantized_transfer_learning_tutorial`
87-
:figure: /_static/img/quantized_transfer_learning.png
88-
8979

9080
.. raw:: html
9181

@@ -135,16 +125,6 @@ Text
135125
:figure: /_static/img/thumbnails/german_to_english_translation.png
136126
:description: :doc:`/beginner/torchtext_translation_tutorial`
137127

138-
.. customgalleryitem::
139-
:tooltip: Perform dynamic quantization on a pre-trained PyTorch model
140-
:description: :doc:`/advanced/dynamic_quantization_tutorial`
141-
:figure: _static/img/quant_asym.png
142-
143-
.. customgalleryitem::
144-
:tooltip: Convert a well-known state-of-the-art model like BERT into dynamic quantized model
145-
:description: :doc:`/intermediate/dynamic_quantization_bert_tutorial`
146-
:figure: /_static/img/bert.png
147-
148128
.. raw:: html
149129

150130
<div style='clear:both'></div>
@@ -161,29 +141,129 @@ Reinforcement Learning
161141

162142
<div style='clear:both'></div>
163143

164-
Additional APIs
144+
Deploying PyTorch Models in Production
145+
--------------------------------------
146+
147+
.. customgalleryitem::
148+
:tooltip: Deploying PyTorch and Building a REST API using Flask
149+
:description: :doc:`/intermediate/flask_rest_api_tutorial`
150+
:figure: _static/img/flask.png
151+
152+
.. customgalleryitem::
153+
:tooltip: Introduction to TorchScript
154+
:description: :doc:`beginner/Intro_to_TorchScript_tutorial`
155+
:figure: _static/img/torchscript.png
156+
157+
.. customgalleryitem::
158+
:tooltip: Loading a PyTorch model in C++
159+
:description: :doc:`advanced/cpp_export`
160+
:figure: _static/img/torchscript_to_cpp.png
161+
162+
.. customgalleryitem::
163+
:figure: /_static/img/cat.jpg
164+
:tooltip: Exporting a Model from PyTorch to ONNX and Running it using ONNXRuntime
165+
:description: :doc:`advanced/super_resolution_with_onnxruntime`
166+
167+
.. raw:: html
168+
169+
<div style='clear:both'></div>
170+
171+
Frontend APIs
165172
----------------------
173+
.. customgalleryitem::
174+
:figure: /_static/img/named_tensor.png
175+
:tooltip: Named Tensor
176+
:description: :doc:`intermediate/named_tensor_tutorial`
166177

167178
.. customgalleryitem::
168179
:tooltip: Using the PyTorch C++ Frontend
169180
:figure: /_static/img/cpp-pytorch.png
170181
:description: :doc:`advanced/cpp_frontend`
171182

183+
.. customgalleryitem::
184+
:tooltip: Implement custom extensions in C++ or CUDA for eager PyTorch
185+
:description: :doc:`/advanced/cpp_extension`
186+
:figure: _static/img/cpp_logo.png
187+
188+
.. customgalleryitem::
189+
:tooltip: Implement custom operators in C++ or CUDA for TorchScript
190+
:description: :doc:`/advanced/torch_script_custom_ops`
191+
:figure: _static/img/cpp_logo.png
192+
193+
.. customgalleryitem::
194+
:tooltip: Implement custom classes in C++ for TorchScript
195+
:description: :doc:`/advanced/torch_script_custom_classes`
196+
:figure: _static/img/cpp_logo.png
197+
172198
.. customgalleryitem::
173199
:tooltip: Autograd in C++ Frontend
174200
:figure: /_static/img/cpp-pytorch.png
175201
:description: :doc:`advanced/cpp_autograd`
176202

177-
.. customgalleryitem::
178-
:figure: /_static/img/named_tensor.png
179-
:tooltip: Named Tensor
180-
:description: :doc:`intermediate/named_tensor_tutorial`
203+
.. raw:: html
204+
205+
<div style='clear:both'></div>
206+
207+
208+
Model Optimization
209+
---------------------------
181210

182211
.. customgalleryitem::
183212
:tooltip: Use pruning to sparsify your neural networks
184213
:description: :doc:`/intermediate/pruning_tutorial`
185214
:figure: _static/img/pruning.png
186215

216+
.. customgalleryitem::
217+
:tooltip: Perform dynamic quantization on a pre-trained PyTorch model
218+
:description: :doc:`/advanced/dynamic_quantization_tutorial`
219+
:figure: _static/img/quant_asym.png
220+
221+
.. customgalleryitem::
222+
:tooltip: Convert a well-known state-of-the-art model like BERT into dynamic quantized model
223+
:description: :doc:`/intermediate/dynamic_quantization_bert_tutorial`
224+
:figure: /_static/img/bert.png
225+
226+
.. customgalleryitem::
227+
:tooltip: (experimental) Static Quantization with Eager Mode in PyTorch
228+
:figure: /_static/img/qat.png
229+
:description: :doc:`advanced/static_quantization_tutorial`
230+
231+
.. customgalleryitem::
232+
:tooltip: Perform quantized transfer learning with feature extractor
233+
:description: :doc:`/intermediate/quantized_transfer_learning_tutorial`
234+
:figure: /_static/img/quantized_transfer_learning.png
235+
236+
.. raw:: html
237+
238+
<div style='clear:both'></div>
239+
240+
Parallel and Distributed Training
241+
---------------------------------
242+
243+
.. customgalleryitem::
244+
:tooltip: Model parallel training on multiple GPUs
245+
:description: :doc:`/intermediate/model_parallel_tutorial`
246+
:figure: _static/img/distributed/DistPyTorch.jpg
247+
248+
.. customgalleryitem::
249+
:tooltip: Getting started with DistributedDataParallel
250+
:description: :doc:`/intermediate/ddp_tutorial`
251+
:figure: _static/img/distributed/DistPyTorch.jpg
252+
253+
.. customgalleryitem::
254+
:tooltip: Parallelize computations across processes and clusters of machines
255+
:description: :doc:`/intermediate/dist_tuto`
256+
:figure: _static/img/distributed/DistPyTorch.jpg
257+
258+
.. customgalleryitem::
259+
:tooltip: Getting Started with Distributed RPC Framework
260+
:description: :doc:`/intermediate/rpc_tutorial`
261+
:figure: _static/img/distributed/DistPyTorch.jpg
262+
263+
.. customgalleryitem::
264+
:tooltip: PyTorch distributed trainer with Amazon AWS
265+
:description: :doc:`/beginner/aws_distributed_training_tutorial`
266+
:figure: _static/img/distributed/DistPyTorch.jpg
187267

188268
.. raw:: html
189269

@@ -214,8 +294,6 @@ Additional APIs
214294
beginner/transfer_learning_tutorial
215295
beginner/fgsm_tutorial
216296
beginner/dcgan_faces_tutorial
217-
advanced/static_quantization_tutorial
218-
intermediate/quantized_transfer_learning_tutorial
219297

220298
.. toctree::
221299
:maxdepth: 2
@@ -237,8 +315,7 @@ Additional APIs
237315
intermediate/seq2seq_translation_tutorial
238316
beginner/text_sentiment_ngrams_tutorial
239317
beginner/torchtext_translation_tutorial
240-
advanced/dynamic_quantization_tutorial
241-
intermediate/dynamic_quantization_bert_tutorial
318+
242319

243320
.. toctree::
244321
:maxdepth: 2
@@ -248,23 +325,50 @@ Additional APIs
248325

249326
intermediate/reinforcement_q_learning
250327

328+
.. toctree::
329+
:maxdepth: 2
330+
:includehidden:
331+
:hidden:
332+
:caption: Deploying PyTorch Models in Production
333+
334+
intermediate/flask_rest_api_tutorial
335+
beginner/Intro_to_TorchScript_tutorial
336+
advanced/cpp_export
337+
advanced/super_resolution_with_onnxruntime
251338

252339
.. toctree::
253340
:maxdepth: 2
254341
:includehidden:
255342
:hidden:
256-
:caption: Additional APIs
343+
:caption: Frontend APIs
257344

345+
intermediate/named_tensor_tutorial
258346
advanced/cpp_frontend
347+
advanced/cpp_extension
348+
advanced/torch_script_custom_ops
349+
advanced/torch_script_custom_classes
259350
advanced/cpp_autograd
260-
intermediate/named_tensor_tutorial
261-
intermediate/pruning_tutorial
262351

352+
.. toctree::
353+
:maxdepth: 2
354+
:includehidden:
355+
:hidden:
356+
:caption: Model Optimization
357+
358+
intermediate/pruning_tutorial
359+
advanced/dynamic_quantization_tutorial
360+
intermediate/dynamic_quantization_bert_tutorial
361+
advanced/static_quantization_tutorial
362+
intermediate/quantized_transfer_learning_tutorial
263363

264364
.. toctree::
265365
:maxdepth: 2
266366
:includehidden:
267367
:hidden:
268-
:caption: Recipes
368+
:caption: Parallel and Distributed Training
269369

270-
recipes/recipes_index
370+
intermediate/model_parallel_tutorial
371+
intermediate/ddp_tutorial
372+
intermediate/dist_tuto
373+
intermediate/rpc_tutorial
374+
beginner/aws_distributed_training_tutorial

recipes/index.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
:orphan:
2+
3+
4+
5+
.. _sphx_glr_recipes:
6+
7+
Recipes
8+
------------------
9+
1. recipes/* and recipes_index.rst
10+
PyTorch Recipes
11+
https://pytorch.org/tutorials/recipes/recipes_index.html
12+
13+
14+
.. raw:: html
15+
16+
<div style='clear:both'></div>
17+
18+
19+
20+
.. only :: html
21+
22+
.. container:: sphx-glr-footer
23+
:class: sphx-glr-footer-gallery
24+
25+
26+
.. container:: sphx-glr-download
27+
28+
:download:`Download all examples in Python source code: recipes_python.zip <//Users/jplin/github/tutorials/recipes/recipes_python.zip>`
29+
30+
31+
32+
.. container:: sphx-glr-download
33+
34+
:download:`Download all examples in Jupyter notebooks: recipes_jupyter.zip <//Users/jplin/github/tutorials/recipes/recipes_jupyter.zip>`
35+
36+
37+
.. only:: html
38+
39+
.. rst-class:: sphx-glr-signature
40+
41+
`Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_

recipes_source/README.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Recipes
2+
------------------
3+
1. recipes/* and recipes_index.rst
4+
PyTorch Recipes
5+
https://pytorch.org/tutorials/recipes/recipes_index.html

0 commit comments

Comments
 (0)