Skip to content

Push latest changes from master into release/1.6 #1074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ intermediate
advanced
pytorch_basics
recipes
prototype

#data things
_data/
Expand Down Expand Up @@ -117,3 +118,6 @@ ENV/
.DS_Store
cleanup.sh
*.swp

# PyTorch things
*.pt
16 changes: 13 additions & 3 deletions .jenkins/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
FILES_TO_RUN+=($(basename $filename .py))
fi
count=$((count+1))
done
for filename in $(find prototype_source/ -name '*.py' -not -path '*/data/*'); do
if [ $(($count % $NUM_WORKERS)) != $WORKER_ID ]; then
echo "Removing runnable code from "$filename
python $DIR/remove_runnable_code.py $filename $filename
else
echo "Keeping "$filename
FILES_TO_RUN+=($(basename $filename .py))
fi
count=$((count+1))
done
echo "FILES_TO_RUN: " ${FILES_TO_RUN[@]}

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

# Step 4: If any of the generated files are not related the tutorial files we want to run,
# then we remove them
for filename in $(find docs/beginner docs/intermediate docs/advanced docs/recipes -name '*.html'); do
for filename in $(find docs/beginner docs/intermediate docs/advanced docs/recipes docs/prototype -name '*.html'); do
file_basename=$(basename $filename .html)
if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
rm $filename
fi
done
for filename in $(find docs/beginner docs/intermediate docs/advanced docs/recipes -name '*.rst'); do
for filename in $(find docs/beginner docs/intermediate docs/advanced docs/recipes docs/prototype -name '*.rst'); do
file_basename=$(basename $filename .rst)
if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
rm $filename
Expand All @@ -124,7 +134,7 @@ if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
rm $filename
fi
done
for filename in $(find docs/.doctrees/beginner docs/.doctrees/intermediate docs/.doctrees/advanced docs/.doctrees/recipes -name '*.doctree'); do
for filename in $(find docs/.doctrees/beginner docs/.doctrees/intermediate docs/.doctrees/advanced docs/.doctrees/recipes docs/.doctrees/prototype -name '*.doctree'); do
file_basename=$(basename $filename .doctree)
if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
rm $filename
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ We use sphinx-gallery's [notebook styled examples](https://sphinx-gallery.github
Here's how to create a new tutorial or recipe:
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. If it is a recipe, add to recipes_source.
2. For Tutorials, include it in the TOC tree at index.rst
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)
2. For Tutorials (except if it is a prototype feature), include it in the TOC tree at index.rst
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)

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.

Expand Down
4 changes: 2 additions & 2 deletions advanced_source/dynamic_quantization_tutorial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
(experimental) Dynamic Quantization on an LSTM Word Language Model
(beta) Dynamic Quantization on an LSTM Word Language Model
==================================================================

**Author**: `James Reed <https://github.com/jamesr66a>`_
Expand All @@ -13,7 +13,7 @@
to int, which can result in smaller model size and faster inference with only a small
hit to accuracy.

In this tutorial, we'll apply the easiest form of quantization -
In this tutorial, we'll apply the easiest form of quantization -
`dynamic quantization <https://pytorch.org/docs/stable/quantization.html#torch.quantization.quantize_dynamic>`_ -
to an LSTM-based next word-prediction model, closely following the
`word language model <https://github.com/pytorch/examples/tree/master/word_language_model>`_
Expand Down
2 changes: 1 addition & 1 deletion advanced_source/neural_style_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
# An important detail to note is that neural networks from the
# torch library are trained with tensor values ranging from 0 to 1. If you
# try to feed the networks with 0 to 255 tensor images, then the activated
# feature maps will be unable sense the intended content and style.
# feature maps will be unable to sense the intended content and style.
# However, pre-trained networks from the Caffe library are trained with 0
# to 255 tensor images.
#
Expand Down
2 changes: 1 addition & 1 deletion advanced_source/static_quantization_tutorial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
(experimental) Static Quantization with Eager Mode in PyTorch
(beta) Static Quantization with Eager Mode in PyTorch
=========================================================

**Author**: `Raghuraman Krishnamoorthi <https://github.com/raghuramank100>`_
Expand Down
Loading