Skip to content

Commit 5aa9d48

Browse files
Jessica Linezyangguyang3532hritikbhandari
authored
Push latest changes from master into release/1.6 (#1074)
* Update feature classification labels * Update NVidia -> Nvidia * Bring back default filename_pattern so that by default we run all galleries. Signed-off-by: Edward Z. Yang <ezyang@fb.com> * Add prototype_source directory * Add prototype directory * Add prototype * Remove extra "done" * Add REAME.txt * Update for prototype instructions * Update for prototype feature * refine torchvision_tutorial doc for windows * Update neural_style_tutorial.py (#1059) Updated the mistake in the Loading Images Section. * torch_script_custom_ops restructure (#1057) Signed-off-by: Edward Z. Yang <ezyang@fb.com> * Port custom ops tutorial to new registration API, increase testability. Signed-off-by: Edward Z. Yang <ezyang@fb.com> * Kill some other occurrences of RegisterOperators Signed-off-by: Edward Z. Yang <ezyang@fb.com> * Update README.md * Make torch_script_custom_classes tutorial runnable I also fixed some warnings in the tutorial, and fixed some minor bitrot (e.g., torch::script::Module to torch::jit::Module) I also added some missing quotes around some bash expansions. Signed-off-by: Edward Z. Yang <ezyang@fb.com> * Update torch_script_custom_classes to use TORCH_LIBRARY (#1062) Signed-off-by: Edward Z. Yang <ezyang@fb.com> Co-authored-by: Edward Z. Yang <ezyang@fb.com> Co-authored-by: Yang Gu <yangu@microsoft.com> Co-authored-by: Hritik Bhandari <bhandari.hritik@gmail.com>
1 parent 569e96f commit 5aa9d48

32 files changed

+695
-583
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ intermediate
44
advanced
55
pytorch_basics
66
recipes
7+
prototype
78

89
#data things
910
_data/
@@ -117,3 +118,6 @@ ENV/
117118
.DS_Store
118119
cleanup.sh
119120
*.swp
121+
122+
# PyTorch things
123+
*.pt

.jenkins/build.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
8686
FILES_TO_RUN+=($(basename $filename .py))
8787
fi
8888
count=$((count+1))
89+
done
90+
for filename in $(find prototype_source/ -name '*.py' -not -path '*/data/*'); do
91+
if [ $(($count % $NUM_WORKERS)) != $WORKER_ID ]; then
92+
echo "Removing runnable code from "$filename
93+
python $DIR/remove_runnable_code.py $filename $filename
94+
else
95+
echo "Keeping "$filename
96+
FILES_TO_RUN+=($(basename $filename .py))
97+
fi
98+
count=$((count+1))
8999
done
90100
echo "FILES_TO_RUN: " ${FILES_TO_RUN[@]}
91101

@@ -94,13 +104,13 @@ if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
94104

95105
# Step 4: If any of the generated files are not related the tutorial files we want to run,
96106
# then we remove them
97-
for filename in $(find docs/beginner docs/intermediate docs/advanced docs/recipes -name '*.html'); do
107+
for filename in $(find docs/beginner docs/intermediate docs/advanced docs/recipes docs/prototype -name '*.html'); do
98108
file_basename=$(basename $filename .html)
99109
if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
100110
rm $filename
101111
fi
102112
done
103-
for filename in $(find docs/beginner docs/intermediate docs/advanced docs/recipes -name '*.rst'); do
113+
for filename in $(find docs/beginner docs/intermediate docs/advanced docs/recipes docs/prototype -name '*.rst'); do
104114
file_basename=$(basename $filename .rst)
105115
if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
106116
rm $filename
@@ -124,7 +134,7 @@ if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
124134
rm $filename
125135
fi
126136
done
127-
for filename in $(find docs/.doctrees/beginner docs/.doctrees/intermediate docs/.doctrees/advanced docs/.doctrees/recipes -name '*.doctree'); do
137+
for filename in $(find docs/.doctrees/beginner docs/.doctrees/intermediate docs/.doctrees/advanced docs/.doctrees/recipes docs/.doctrees/prototype -name '*.doctree'); do
128138
file_basename=$(basename $filename .doctree)
129139
if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
130140
rm $filename

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ We use sphinx-gallery's [notebook styled examples](https://sphinx-gallery.github
1414
Here's how to create a new tutorial or recipe:
1515
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`.
1616
2. Put it in one of the beginner_source, intermediate_source, advanced_source based on the level. If it is a recipe, add to recipes_source.
17-
2. For Tutorials, include it in the TOC tree at index.rst
18-
3. For Tutorials, create a thumbnail in the [index.rst file](https://github.com/pytorch/tutorials/blob/master/index.rst) using a command like `.. customcarditem:: beginner/your_tutorial.html`. For Recipes, create a thumbnail in the [recipes_index.rst](https://github.com/pytorch/tutorials/blob/master/recipes_source/recipes_index.rst)
17+
2. For Tutorials (except if it is a prototype feature), include it in the TOC tree at index.rst
18+
3. For Tutorials (except if it is a prototype feature), create a thumbnail in the [index.rst file](https://github.com/pytorch/tutorials/blob/master/index.rst) using a command like `.. customcarditem:: beginner/your_tutorial.html`. For Recipes, create a thumbnail in the [recipes_index.rst](https://github.com/pytorch/tutorials/blob/master/recipes_source/recipes_index.rst)
1919

2020
In case you prefer to write your tutorial in jupyter, you can use [this script](https://gist.github.com/chsasank/7218ca16f8d022e02a9c0deb94a310fe) 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.
2121

advanced_source/dynamic_quantization_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
(experimental) Dynamic Quantization on an LSTM Word Language Model
2+
(beta) Dynamic Quantization on an LSTM Word Language Model
33
==================================================================
44
55
**Author**: `James Reed <https://github.com/jamesr66a>`_
@@ -13,7 +13,7 @@
1313
to int, which can result in smaller model size and faster inference with only a small
1414
hit to accuracy.
1515
16-
In this tutorial, we'll apply the easiest form of quantization -
16+
In this tutorial, we'll apply the easiest form of quantization -
1717
`dynamic quantization <https://pytorch.org/docs/stable/quantization.html#torch.quantization.quantize_dynamic>`_ -
1818
to an LSTM-based next word-prediction model, closely following the
1919
`word language model <https://github.com/pytorch/examples/tree/master/word_language_model>`_

advanced_source/neural_style_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
# An important detail to note is that neural networks from the
8484
# torch library are trained with tensor values ranging from 0 to 1. If you
8585
# try to feed the networks with 0 to 255 tensor images, then the activated
86-
# feature maps will be unable sense the intended content and style.
86+
# feature maps will be unable to sense the intended content and style.
8787
# However, pre-trained networks from the Caffe library are trained with 0
8888
# to 255 tensor images.
8989
#

advanced_source/static_quantization_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
(experimental) Static Quantization with Eager Mode in PyTorch
2+
(beta) Static Quantization with Eager Mode in PyTorch
33
=========================================================
44
55
**Author**: `Raghuraman Krishnamoorthi <https://github.com/raghuramank100>`_

0 commit comments

Comments
 (0)