Skip to content

Commit e69ff9e

Browse files
authored
Merge branch 'master' into pr/torch_script_custom_ops_runnable
2 parents 8891664 + 67f76d3 commit e69ff9e

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

.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

conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@
6363

6464
sphinx_gallery_conf = {
6565
'examples_dirs': ['beginner_source', 'intermediate_source',
66-
'advanced_source', 'recipes_source'],
67-
'gallery_dirs': ['beginner', 'intermediate', 'advanced', 'recipes'],
66+
'advanced_source', 'recipes_source', 'prototype_source'],
67+
'gallery_dirs': ['beginner', 'intermediate', 'advanced', 'recipes', 'prototype'],
68+
'filename_pattern': 'tutorial.py',
6869
'backreferences_dir': False
6970
}
7071

prototype_source/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Prototype Tutorials
2+
3+
This directory contains tutorials demonstrating prototype features in PyTorch.
4+
5+
**Prototype features** are not available as part of binary distributions like PyPI or Conda (except maybe behind run-time flags). To test these features we would, depending on the feature, recommend building from master or using the nightly wheelss that are made available on pytorch.org.
6+
7+
*Level of commitment:* We are committing to gathering high bandwidth feedback only on these features. Based on this feedback and potential further engagement between community members, we as a community will decide if we want to upgrade the level of commitment or to fail fast.

prototype_source/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Prototype Tutorials
2+
------------------

0 commit comments

Comments
 (0)