Skip to content

Commit 1d11de0

Browse files
author
Jessica Lin
committed
Adding Zafar's changes from PR #758 to run flags + gitignore additions
1 parent 8ac30a9 commit 1d11de0

File tree

3 files changed

+34
-20
lines changed

3 files changed

+34
-20
lines changed

.gitignore

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ pytorch_basics
66

77
#data things
88
_data/
9-
beginner_source/hymenoptera_data
10-
beginner_source/blitz/data
11-
beginner_source/faces
12-
beginner_source/hybrid_frontend/data
13-
intermediate_source/data/
149
advanced_source/images/
15-
*data.zip
16-
faces.zip
10+
advanced_source/data/
11+
beginner_source/.data/
12+
beginner_source/data/
13+
beginner_source/blitz/data/
14+
beginner_source/faces/
15+
beginner_source/hybrid_frontend/data/
16+
beginner_source/hymenoptera_data/
17+
intermediate_source/data/
18+
*.zip
19+
MNIST/
1720

1821
#builds
1922
_build/
@@ -94,7 +97,7 @@ target/
9497
.python-version
9598

9699
# celery beat schedule file
97-
celerybeat-schedule
100+
celerybeat-schedule
98101
# dotenv
99102
.env
100103

Makefile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
export LC_ALL=C
66

77
# You can set these variables from the command line.
8-
SPHINXOPTS =
8+
SPHINXOPTS ?=
99
SPHINXBUILD = sphinx-build
1010
SPHINXPROJ = PyTorchTutorials
1111
SOURCEDIR = .
1212
BUILDDIR = _build
1313
DATADIR = _data
1414
GH_PAGES_SOURCES = $(SOURCEDIR) Makefile
1515

16+
ZIPOPTS ?= -qo
17+
TAROPTS ?=
18+
1619
# Put it first so that "make" without argument is like "make help".
1720
help:
1821
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -43,15 +46,15 @@ download:
4346

4447
# transfer learning tutorial data
4548
wget -N https://download.pytorch.org/tutorial/hymenoptera_data.zip -P $(DATADIR)
46-
unzip -o $(DATADIR)/hymenoptera_data.zip -d beginner_source/data/
49+
unzip $(ZIPOPTS) $(DATADIR)/hymenoptera_data.zip -d beginner_source/data/
4750

4851
# nlp tutorial data
4952
wget -N https://download.pytorch.org/tutorial/data.zip -P $(DATADIR)
50-
unzip -o $(DATADIR)/data.zip -d intermediate_source/ # This will unzip all files in data.zip to intermediate_source/data/ folder
53+
unzip $(ZIPOPTS) $(DATADIR)/data.zip -d intermediate_source/ # This will unzip all files in data.zip to intermediate_source/data/ folder
5154

5255
# data loader tutorial
5356
wget -N https://download.pytorch.org/tutorial/faces.zip -P $(DATADIR)
54-
unzip -o $(DATADIR)/faces.zip -d beginner_source/data/
57+
unzip $(ZIPOPTS) $(DATADIR)/faces.zip -d beginner_source/data/
5558

5659
wget -N https://download.pytorch.org/models/tutorials/4000_checkpoint.tar -P $(DATADIR)
5760
cp $(DATADIR)/4000_checkpoint.tar beginner_source/data/
@@ -63,19 +66,19 @@ download:
6366

6467
# Download dataset for beginner_source/dcgan_faces_tutorial.py
6568
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/img_align_celeba.zip -P $(DATADIR)
66-
unzip -q -o $(DATADIR)/img_align_celeba.zip -d beginner_source/data/celeba
69+
unzip $(ZIPOPTS) $(DATADIR)/img_align_celeba.zip -d beginner_source/data/celeba
6770

6871
# Download dataset for beginner_source/hybrid_frontend/introduction_to_hybrid_frontend_tutorial.py
6972
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/iris.data -P $(DATADIR)
7073
cp $(DATADIR)/iris.data beginner_source/data/
7174

7275
# Download dataset for beginner_source/chatbot_tutorial.py
7376
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/cornell_movie_dialogs_corpus.zip -P $(DATADIR)
74-
unzip -q -o $(DATADIR)/cornell_movie_dialogs_corpus.zip -d beginner_source/data/
77+
unzip $(ZIPOPTS) $(DATADIR)/cornell_movie_dialogs_corpus.zip -d beginner_source/data/
7578

7679
# Download dataset for beginner_source/audio_classifier_tutorial.py
7780
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/UrbanSound8K.tar.gz -P $(DATADIR)
78-
tar -xzf $(DATADIR)/UrbanSound8K.tar.gz -C ./beginner_source/data/
81+
tar $(TAROPTS) -xzf $(DATADIR)/UrbanSound8K.tar.gz -C ./beginner_source/data/
7982

8083
# Download model for beginner_source/fgsm_tutorial.py
8184
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/lenet_mnist_model.pth -P $(DATADIR)
@@ -87,16 +90,15 @@ download:
8790

8891
# Download data for advanced_source/dynamic_quantization_tutorial.py
8992
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/wikitext-2.zip -P $(DATADIR)
90-
unzip -q -o $(DATADIR)/wikitext-2.zip -d advanced_source/data/
93+
unzip $(ZIPOPTS) $(DATADIR)/wikitext-2.zip -d advanced_source/data/
9194

9295
# Download model for advanced_source/static_quantization_tutorial.py
9396
wget -N https://download.pytorch.org/models/mobilenet_v2-b0353104.pth -P $(DATADIR)
9497
cp $(DATADIR)/mobilenet_v2-b0353104.pth advanced_source/data/mobilenet_pretrained_float.pth
9598

9699
# Download dataset for advanced_source/static_quantization_tutorial.py
97100
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/imagenet_1k.zip -P $(DATADIR)
98-
unzip -q -o $(DATADIR)/imagenet_1k.zip -d advanced_source/data/
99-
101+
unzip $(ZIPOPTS) $(DATADIR)/imagenet_1k.zip -d advanced_source/data/
100102

101103
docs:
102104
make download

conf.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
#
1313
# All configuration values have a default; values that are commented out
1414
# serve to show the default.
15+
#
16+
17+
# Because the sphinx gallery might take a long time, you can control specific
18+
# files that generate the results using `GALLERY_PATTERN` environment variable,
19+
# For example to run only `neural_style_transfer_tutorial.py`:
20+
# GALLERY_PATTERN="neural_style_transfer_tutorial.py" make html
21+
# or
22+
# GALLERY_PATTERN="neural_style_transfer_tutorial.py" sphinx-build . _build
23+
#
24+
# GALLERY_PATTERN variable respects regular expressions.
1525

1626
# If extensions (or modules to document with autodoc) are in another directory,
1727
# add these directories to sys.path here. If the directory is relative to the
@@ -49,12 +59,11 @@
4959

5060
# -- Sphinx-gallery configuration --------------------------------------------
5161

52-
5362
sphinx_gallery_conf = {
5463
'examples_dirs': ['beginner_source', 'intermediate_source',
5564
'advanced_source'],
5665
'gallery_dirs': ['beginner', 'intermediate', 'advanced'],
57-
'filename_pattern': 'tutorial.py',
66+
'filename_pattern': os.environ.get('GALLERY_PATTERN', r'tutorial.py'),
5867
'backreferences_dir': False
5968
}
6069

0 commit comments

Comments
 (0)