Skip to content

Commit b3d288e

Browse files
author
Hyoyoung CHANG
committed
init commit
0 parents  commit b3d288e

File tree

561 files changed

+77380
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

561 files changed

+77380
-0
lines changed

.gitignore

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# sphinx things
2+
beginner
3+
intermediate
4+
advanced
5+
pytorch_basics
6+
recipes
7+
prototype
8+
9+
#data things
10+
_data/
11+
advanced_source/images/
12+
advanced_source/data/
13+
beginner_source/.data/
14+
beginner_source/data/
15+
beginner_source/blitz/data/
16+
beginner_source/faces/
17+
beginner_source/hybrid_frontend/data/
18+
beginner_source/hymenoptera_data/
19+
intermediate_source/data/
20+
*.zip
21+
MNIST/
22+
23+
#builds
24+
_build/
25+
_static/thumbs/
26+
27+
# Byte-compiled / optimized / DLL files
28+
__pycache__/
29+
*.py[cod]
30+
*$py.class
31+
32+
# C extensions
33+
*.so
34+
35+
# Distribution / packaging
36+
src/
37+
.Python
38+
env/
39+
build/
40+
develop-eggs/
41+
dist/
42+
downloads/
43+
eggs/
44+
.eggs/
45+
lib/
46+
lib64/
47+
parts/
48+
sdist/
49+
var/
50+
*.egg-info/
51+
.installed.cfg
52+
*.egg
53+
54+
# PyInstaller
55+
# Usually these files are written by a python script from a template
56+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
57+
*.manifest
58+
*.spec
59+
60+
# Installer logs
61+
pip-log.txt
62+
pip-delete-this-directory.txt
63+
64+
# Unit test / coverage reports
65+
htmlcov/
66+
.tox/
67+
.coverage
68+
.coverage.*
69+
.cache
70+
nosetests.xml
71+
coverage.xml
72+
*,cover
73+
.hypothesis/
74+
75+
# Translations
76+
*.mo
77+
*.pot
78+
79+
# Django stuff:
80+
*.log
81+
local_settings.py
82+
83+
# Flask stuff:
84+
instance/
85+
.webassets-cache
86+
87+
# Scrapy stuff:
88+
.scrapy
89+
90+
# Sphinx documentation
91+
docs/_build/
92+
93+
# PyBuilder
94+
target/
95+
96+
# IPython Notebook
97+
.ipynb_checkpoints
98+
99+
# pyenv
100+
.python-version
101+
102+
# celery beat schedule file
103+
celerybeat-schedule
104+
# dotenv
105+
.env
106+
107+
# virtualenv
108+
venv/
109+
ENV/
110+
111+
# Spyder project settings
112+
.spyderproject
113+
114+
# Rope project settings
115+
.ropeproject
116+
117+
# Mac things
118+
.DS_Store
119+
cleanup.sh
120+
*.swp
121+
122+
# PyTorch things
123+
*.pt
124+
125+
# VSCode
126+
*.vscode

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "src/pytorch-sphinx-theme"]
2+
path = src/pytorch-sphinx-theme
3+
url = https://github.com/pytorch/pytorch_sphinx_theme

CODE_OF_CONDUCT.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <[email protected]>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing to tutorials
2+
We want to make contributing to this project as easy and transparent as
3+
possible.
4+
5+
## Pull Requests
6+
We actively welcome your pull requests.
7+
8+
1. Fork the repo and create your branch from `master`.
9+
2. If you've added code that should be tested, add tests.
10+
3. If you've changed APIs, update the documentation.
11+
4. Ensure the test suite passes.
12+
5. Make sure your code lints.
13+
6. If you haven't already, complete the Contributor License Agreement ("CLA").
14+
15+
## Contributor License Agreement ("CLA")
16+
In order to accept your pull request, we need you to submit a CLA. You only need
17+
to do this once to work on any of Facebook's open source projects.
18+
19+
Complete your CLA here: <https://code.facebook.com/cla>
20+
21+
## Issues
22+
We use GitHub issues to track public bugs. Please ensure your description is
23+
clear and has sufficient instructions to be able to reproduce the issue.
24+
25+
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
26+
disclosure of security bugs. In those cases, please go through the process
27+
outlined on that page and do not file a public issue.
28+
29+
## License
30+
By contributing to tutorials, you agree that your contributions will be licensed
31+
under the LICENSE file in the root directory of this source tree.

LICENSE

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2017-2022, Pytorch contributors
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# Locale
5+
export LC_ALL=C
6+
7+
# You can set these variables from the command line.
8+
SPHINXOPTS ?=
9+
SPHINXBUILD = sphinx-build
10+
SPHINXPROJ = PyTorchTutorials
11+
SOURCEDIR = .
12+
BUILDDIR = _build
13+
DATADIR = _data
14+
GH_PAGES_SOURCES = $(SOURCEDIR) Makefile
15+
16+
ZIPOPTS ?= -qo
17+
TAROPTS ?=
18+
19+
# Put it first so that "make" without argument is like "make help".
20+
help:
21+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
22+
23+
.PHONY: help Makefile docs
24+
25+
# Catch-all target: route all unknown targets to Sphinx using the new
26+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
27+
%: Makefile
28+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -v
29+
30+
download:
31+
# IMPORTANT NOTE: Please make sure your dataset is downloaded to *_source/data folder,
32+
# otherwise CI might silently break.
33+
34+
# NOTE: Please consider using the Step1 and one of Step2 for new dataset,
35+
# [something] should be replaced with the actual value.
36+
# Step1. DOWNLOAD: wget -N [SOURCE_FILE] -P $(DATADIR)
37+
# Step2-1. UNZIP: unzip -o $(DATADIR)/[SOURCE_FILE] -d [*_source/data/]
38+
# Step2-2. UNTAR: tar -xzf $(DATADIR)/[SOURCE_FILE] -C [*_source/data/]
39+
# Step2-3. AS-IS: cp $(DATADIR)/[SOURCE_FILE] [*_source/data/]
40+
41+
# make data directories
42+
mkdir -p $(DATADIR)
43+
mkdir -p advanced_source/data
44+
mkdir -p beginner_source/data
45+
mkdir -p intermediate_source/data
46+
mkdir -p prototype_source/data
47+
48+
# transfer learning tutorial data
49+
wget -N https://download.pytorch.org/tutorial/hymenoptera_data.zip -P $(DATADIR)
50+
unzip $(ZIPOPTS) $(DATADIR)/hymenoptera_data.zip -d beginner_source/data/
51+
52+
# nlp tutorial data
53+
wget -N https://download.pytorch.org/tutorial/data.zip -P $(DATADIR)
54+
unzip $(ZIPOPTS) $(DATADIR)/data.zip -d intermediate_source/ # This will unzip all files in data.zip to intermediate_source/data/ folder
55+
56+
# data loader tutorial
57+
wget -N https://download.pytorch.org/tutorial/faces.zip -P $(DATADIR)
58+
unzip $(ZIPOPTS) $(DATADIR)/faces.zip -d beginner_source/data/
59+
60+
wget -N https://download.pytorch.org/models/tutorials/4000_checkpoint.tar -P $(DATADIR)
61+
cp $(DATADIR)/4000_checkpoint.tar beginner_source/data/
62+
63+
# neural style images
64+
rm -rf advanced_source/data/images/ || true
65+
mkdir -p advanced_source/data/images/
66+
cp -r _static/img/neural-style/ advanced_source/data/images/
67+
68+
# Download dataset for beginner_source/dcgan_faces_tutorial.py
69+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/img_align_celeba.zip -P $(DATADIR)
70+
unzip $(ZIPOPTS) $(DATADIR)/img_align_celeba.zip -d beginner_source/data/celeba
71+
72+
# Download dataset for beginner_source/hybrid_frontend/introduction_to_hybrid_frontend_tutorial.py
73+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/iris.data -P $(DATADIR)
74+
cp $(DATADIR)/iris.data beginner_source/data/
75+
76+
# Download dataset for beginner_source/chatbot_tutorial.py
77+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/cornell_movie_dialogs_corpus.zip -P $(DATADIR)
78+
unzip $(ZIPOPTS) $(DATADIR)/cornell_movie_dialogs_corpus.zip -d beginner_source/data/
79+
80+
# Download dataset for beginner_source/audio_classifier_tutorial.py
81+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/UrbanSound8K.tar.gz -P $(DATADIR)
82+
tar $(TAROPTS) -xzf $(DATADIR)/UrbanSound8K.tar.gz -C ./beginner_source/data/
83+
84+
# Download model for beginner_source/fgsm_tutorial.py
85+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/lenet_mnist_model.pth -P $(DATADIR)
86+
cp $(DATADIR)/lenet_mnist_model.pth ./beginner_source/data/lenet_mnist_model.pth
87+
88+
# Download model for advanced_source/dynamic_quantization_tutorial.py
89+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/word_language_model_quantize.pth -P $(DATADIR)
90+
cp $(DATADIR)/word_language_model_quantize.pth advanced_source/data/word_language_model_quantize.pth
91+
92+
# Download data for advanced_source/dynamic_quantization_tutorial.py
93+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/wikitext-2.zip -P $(DATADIR)
94+
unzip $(ZIPOPTS) $(DATADIR)/wikitext-2.zip -d advanced_source/data/
95+
96+
# Download model for advanced_source/static_quantization_tutorial.py
97+
wget -N https://download.pytorch.org/models/mobilenet_v2-b0353104.pth -P $(DATADIR)
98+
cp $(DATADIR)/mobilenet_v2-b0353104.pth advanced_source/data/mobilenet_pretrained_float.pth
99+
100+
101+
# Download model for prototype_source/graph_mode_static_quantization_tutorial.py
102+
wget -N https://download.pytorch.org/models/resnet18-5c106cde.pth -P $(DATADIR)
103+
cp $(DATADIR)/resnet18-5c106cde.pth prototype_source/data/resnet18_pretrained_float.pth
104+
105+
106+
docs:
107+
make download
108+
make html
109+
rm -rf docs
110+
cp -r $(BUILDDIR)/html docs
111+
touch docs/.nojekyll
112+
113+
html-noplot:
114+
$(SPHINXBUILD) -D plot_gallery=0 -b html $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/html"
115+
# bash .jenkins/remove_invisible_code_block_batch.sh "$(BUILDDIR)/html"
116+
@echo
117+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
118+
119+
clean-cache:
120+
make clean
121+
rm -rf advanced beginner intermediate recipes

0 commit comments

Comments
 (0)