Skip to content

Commit ff0befc

Browse files
committed
PyTorch v1.13 반영, pytorch/tutorials@db34a77 (PyTorchKorea#615)
1 parent bb04c46 commit ff0befc

File tree

122 files changed

+6802
-1540
lines changed

Some content is hidden

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

122 files changed

+6802
-1540
lines changed

β€Ž.build/validate_tutorials_built.py

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
from pathlib import Path
2+
from typing import List
3+
4+
from bs4 import BeautifulSoup
5+
6+
REPO_ROOT = Path(__file__).parent.parent
7+
8+
# For every tutorial on this list, we should determine if it is ok to not run the tutorial (add a comment after
9+
# the file name to explain why, like intro.html), or fix the tutorial and remove it from this list).
10+
11+
NOT_RUN = [
12+
"basics/intro", # no code
13+
"translation_transformer",
14+
"profiler",
15+
"saving_loading_models",
16+
"introyt/captumyt",
17+
"introyt/trainingyt",
18+
"examples_nn/polynomial_module",
19+
"examples_nn/dynamic_net",
20+
"examples_nn/polynomial_optim",
21+
"former_torchies/autograd_tutorial_old",
22+
"former_torchies/tensor_tutorial_old",
23+
"examples_autograd/polynomial_autograd",
24+
"examples_autograd/polynomial_custom_function",
25+
"parametrizations",
26+
"mnist_train_nas", # used by ax_multiobjective_nas_tutorial.py
27+
"fx_conv_bn_fuser",
28+
"super_resolution_with_onnxruntime",
29+
"ddp_pipeline", # requires 4 gpus
30+
"fx_graph_mode_ptq_dynamic",
31+
"vmap_recipe",
32+
"torchscript_freezing",
33+
"nestedtensor",
34+
"recipes/saving_and_loading_models_for_inference",
35+
"recipes/saving_multiple_models_in_one_file",
36+
"recipes/loading_data_recipe",
37+
"recipes/tensorboard_with_pytorch",
38+
"recipes/what_is_state_dict",
39+
"recipes/profiler_recipe",
40+
"recipes/save_load_across_devices",
41+
"recipes/warmstarting_model_using_parameters_from_a_different_model",
42+
"recipes/dynamic_quantization",
43+
"recipes/saving_and_loading_a_general_checkpoint",
44+
"recipes/benchmark",
45+
"recipes/tuning_guide",
46+
"recipes/zeroing_out_gradients",
47+
"recipes/defining_a_neural_network",
48+
"recipes/timer_quick_start",
49+
"recipes/amp_recipe",
50+
"recipes/Captum_Recipe",
51+
"hyperparameter_tuning_tutorial",
52+
"flask_rest_api_tutorial",
53+
"text_to_speech_with_torchaudio",
54+
]
55+
56+
57+
def tutorial_source_dirs() -> List[Path]:
58+
return [
59+
p.relative_to(REPO_ROOT).with_name(p.stem[:-7])
60+
for p in REPO_ROOT.glob("*_source")
61+
]
62+
63+
64+
def main() -> None:
65+
docs_dir = REPO_ROOT / "docs"
66+
html_file_paths = []
67+
for tutorial_source_dir in tutorial_source_dirs():
68+
glob_path = f"{tutorial_source_dir}/**/*.html"
69+
html_file_paths += docs_dir.glob(glob_path)
70+
71+
did_not_run = []
72+
for html_file_path in html_file_paths:
73+
with open(html_file_path, "r", encoding="utf-8") as html_file:
74+
html = html_file.read()
75+
html_soup = BeautifulSoup(html, "html.parser")
76+
elems = html_soup.find_all("p", {"class": "sphx-glr-timing"})
77+
for elem in elems:
78+
if (
79+
"Total running time of the script: ( 0 minutes 0.000 seconds)"
80+
in elem.text
81+
and not any(
82+
html_file_path.match(file) for file in NOT_RUN
83+
)
84+
):
85+
did_not_run.append(html_file_path.as_posix())
86+
87+
if len(did_not_run) != 0:
88+
raise RuntimeError(
89+
"The following file(s) are not known bad but ran in 0.000 sec, meaning that any "
90+
+ "python code in this tutorial probably didn't run:\n{}".format(
91+
"\n".join(did_not_run)
92+
)
93+
)
94+
95+
96+
if __name__ == "__main__":
97+
main()

β€Ž.github/ISSUE_TEMPLATE/1_TRANSLATE_REQUEST.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ _(λ°˜λ“œμ‹œ 지킀셔야 ν•˜λŠ” 일정이 μ•„λ‹™λ‹ˆλ‹€ - 일정이 λ„ˆλ¬΄ λŠ¦μ–΄
1515
## κ΄€λ ¨ 이슈
1616
_ν˜„μž¬ λ²ˆμ—­ μš”μ²­ / 진행 내역을 보기 μœ„ν•΄ 각 λ²„μ „μ˜ 메인 이슈λ₯Ό μ°Έμ‘°ν•©λ‹ˆλ‹€._ <br />
1717
_(νŠΉλ³„ν•œ 일이 μ—†λ‹€λ©΄ λ³€κ²½ν•˜μ§€ μ•ŠμœΌμ…”λ„ λ©λ‹ˆλ‹€.)_
18-
* κ΄€λ ¨ 이슈: #483 (v1.12)
18+
* κ΄€λ ¨ 이슈: #615 (v1.13)

β€ŽMakefile

+19-15
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ download:
3333

3434
# NOTE: Please consider using the Step1 and one of Step2 for new dataset,
3535
# [something] should be replaced with the actual value.
36-
# Step1. DOWNLOAD: wget -N [SOURCE_FILE] -P $(DATADIR)
36+
# Step1. DOWNLOAD: wget -nv -N [SOURCE_FILE] -P $(DATADIR)
3737
# Step2-1. UNZIP: unzip -o $(DATADIR)/[SOURCE_FILE] -d [*_source/data/]
3838
# Step2-2. UNTAR: tar -xzf $(DATADIR)/[SOURCE_FILE] -C [*_source/data/]
3939
# Step2-3. AS-IS: cp $(DATADIR)/[SOURCE_FILE] [*_source/data/]
@@ -46,18 +46,18 @@ download:
4646
mkdir -p prototype_source/data
4747

4848
# transfer learning tutorial data
49-
wget -N https://download.pytorch.org/tutorial/hymenoptera_data.zip -P $(DATADIR)
49+
wget -nv -N https://download.pytorch.org/tutorial/hymenoptera_data.zip -P $(DATADIR)
5050
unzip $(ZIPOPTS) $(DATADIR)/hymenoptera_data.zip -d beginner_source/data/
5151

5252
# nlp tutorial data
53-
wget -N https://download.pytorch.org/tutorial/data.zip -P $(DATADIR)
53+
wget -nv -N https://download.pytorch.org/tutorial/data.zip -P $(DATADIR)
5454
unzip $(ZIPOPTS) $(DATADIR)/data.zip -d intermediate_source/ # This will unzip all files in data.zip to intermediate_source/data/ folder
5555

5656
# data loader tutorial
57-
wget -N https://download.pytorch.org/tutorial/faces.zip -P $(DATADIR)
57+
wget -nv -N https://download.pytorch.org/tutorial/faces.zip -P $(DATADIR)
5858
unzip $(ZIPOPTS) $(DATADIR)/faces.zip -d beginner_source/data/
5959

60-
wget -N https://download.pytorch.org/models/tutorials/4000_checkpoint.tar -P $(DATADIR)
60+
wget -nv -N https://download.pytorch.org/models/tutorials/4000_checkpoint.tar -P $(DATADIR)
6161
cp $(DATADIR)/4000_checkpoint.tar beginner_source/data/
6262

6363
# neural style images
@@ -66,41 +66,45 @@ download:
6666
cp -r _static/img/neural-style/ advanced_source/data/images/
6767

6868
# 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)
69+
wget -nv -N https://s3.amazonaws.com/pytorch-tutorial-assets/img_align_celeba.zip -P $(DATADIR)
7070
unzip $(ZIPOPTS) $(DATADIR)/img_align_celeba.zip -d beginner_source/data/celeba
7171

7272
# 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)
73+
wget -nv -N https://s3.amazonaws.com/pytorch-tutorial-assets/iris.data -P $(DATADIR)
7474
cp $(DATADIR)/iris.data beginner_source/data/
7575

7676
# 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/
77+
wget -nv -N https://s3.amazonaws.com/pytorch-tutorial-assets/cornell_movie_dialogs_corpus_v2.zip -P $(DATADIR)
78+
unzip $(ZIPOPTS) $(DATADIR)/cornell_movie_dialogs_corpus_v2.zip -d beginner_source/data/
7979

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

8484
# Download model for beginner_source/fgsm_tutorial.py
85-
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/lenet_mnist_model.pth -P $(DATADIR)
85+
wget -nv -N https://s3.amazonaws.com/pytorch-tutorial-assets/lenet_mnist_model.pth -P $(DATADIR)
8686
cp $(DATADIR)/lenet_mnist_model.pth ./beginner_source/data/lenet_mnist_model.pth
8787

8888
# 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)
89+
wget -nv -N https://s3.amazonaws.com/pytorch-tutorial-assets/word_language_model_quantize.pth -P $(DATADIR)
9090
cp $(DATADIR)/word_language_model_quantize.pth advanced_source/data/word_language_model_quantize.pth
9191

9292
# Download data for advanced_source/dynamic_quantization_tutorial.py
93-
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/wikitext-2.zip -P $(DATADIR)
93+
wget -nv -N https://s3.amazonaws.com/pytorch-tutorial-assets/wikitext-2.zip -P $(DATADIR)
9494
unzip $(ZIPOPTS) $(DATADIR)/wikitext-2.zip -d advanced_source/data/
9595

9696
# Download model for advanced_source/static_quantization_tutorial.py
97-
wget -N https://download.pytorch.org/models/mobilenet_v2-b0353104.pth -P $(DATADIR)
97+
wget -nv -N https://download.pytorch.org/models/mobilenet_v2-b0353104.pth -P $(DATADIR)
9898
cp $(DATADIR)/mobilenet_v2-b0353104.pth advanced_source/data/mobilenet_pretrained_float.pth
9999

100100
# Download model for prototype_source/graph_mode_static_quantization_tutorial.py
101-
wget -N https://download.pytorch.org/models/resnet18-5c106cde.pth -P $(DATADIR)
101+
wget -nv -N https://download.pytorch.org/models/resnet18-5c106cde.pth -P $(DATADIR)
102102
cp $(DATADIR)/resnet18-5c106cde.pth prototype_source/data/resnet18_pretrained_float.pth
103103

104+
# Download vocab for beginner_source/flava_finetuning_tutorial.py
105+
wget -nv -N http://dl.fbaipublicfiles.com/pythia/data/vocab.tar.gz -P $(DATADIR)
106+
tar $(TAROPTS) -xzf $(DATADIR)/vocab.tar.gz -C ./beginner_source/data/
107+
104108
# Download some dataset for beginner_source/translation_transformer.py
105109
python -m spacy download en_core_web_sm
106110
python -m spacy download de_core_news_sm

β€ŽREADME.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## μ†Œκ°œ
44

55
PyTorchμ—μ„œ μ œκ³΅ν•˜λŠ” νŠœν† λ¦¬μ–Όμ˜ ν•œκ΅­μ–΄ λ²ˆμ—­μ„ μœ„ν•œ μ €μž₯μ†Œμž…λ‹ˆλ‹€.\
6-
λ²ˆμ—­μ˜ 결과물은 [https://tutorials.pytorch.kr](https://tutorials.pytorch.kr)μ—μ„œ ν™•μΈν•˜μ‹€ 수 μžˆμŠ΅λ‹ˆλ‹€. (λ²ˆμ—­μ„ μ§„ν–‰ν•˜λ©° **λΆˆκ·œμΉ™μ μœΌλ‘œ** μ—…λ°μ΄νŠΈν•©λ‹ˆλ‹€.)\
7-
ν˜„μž¬ λ²„μ „μ˜ λ²ˆμ—­ / λ³€κ²½ κ΄€λ ¨ μ΄μŠˆλŠ” [#483 이슈](https://github.com/PyTorchKorea/tutorials-kr/issues/483)λ₯Ό μ°Έκ³ ν•΄μ£Όμ„Έμš”.
6+
λ²ˆμ—­μ˜ 결과물은 [https://tutorials.pytorch.kr](https://tutorials.pytorch.kr)μ—μ„œ ν™•μΈν•˜μ‹€ 수 μžˆμŠ΅λ‹ˆλ‹€. (λ²ˆμ—­μ„ μ§„ν–‰ν•˜λ©° **λΉ„μ •κΈ°μ μœΌλ‘œ** λ°˜μ˜ν•©λ‹ˆλ‹€.)\
7+
ν˜„μž¬ λ²„μ „μ˜ λ²ˆμ—­ / λ³€κ²½ κ΄€λ ¨ μ΄μŠˆλŠ” [#615 이슈](https://github.com/PyTorchKorea/tutorials-kr/issues/615)λ₯Ό μ°Έκ³ ν•΄μ£Όμ„Έμš”.
88

99
## κΈ°μ—¬ν•˜κΈ°
1010

@@ -22,7 +22,7 @@ PyTorchμ—μ„œ μ œκ³΅ν•˜λŠ” νŠœν† λ¦¬μ–Όμ˜ ν•œκ΅­μ–΄ λ²ˆμ—­μ„ μœ„ν•œ μ €μž₯μ†Œ
2222

2323
## 원문
2424

25-
ν˜„μž¬ PyTorch v1.12 νŠœν† λ¦¬μ–Ό([pytorch/tutorials@0918023](https://github.com/pytorch/tutorials/commit/091802395ed6cc5563643b6b6ef54ba99d412e66) κΈ°μ€€) λ²ˆμ—­μ΄ 진행 μ€‘μž…λ‹ˆλ‹€.
25+
ν˜„μž¬ PyTorch v1.13 νŠœν† λ¦¬μ–Ό([pytorch/tutorials@db34a77](https://github.com/pytorch/tutorials/commit/db34a779242f1a71346db4a9e5d6ac962a8d9b77) κΈ°μ€€) λ²ˆμ—­μ΄ 진행 μ€‘μž…λ‹ˆλ‹€.
2626

2727
μ΅œμ‹  λ²„μ „μ˜ νŠœν† λ¦¬μ–Ό(곡식, μ˜μ–΄)은 [PyTorch tutorials μ‚¬μ΄νŠΈ](https://pytorch.org/tutorials) 및 [PyTorch tutorials μ €μž₯μ†Œ](https://github.com/pytorch/tutorials)λ₯Ό μ°Έκ³ ν•΄μ£Όμ„Έμš”.
2828

@@ -46,5 +46,5 @@ v1.0 이후 λ²ˆμ—­μ€ 별도 μ €μž₯μ†Œλ‘œ κ΄€λ¦¬ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. [이 μ €μž₯
4646
λΉŒλ“œ 방법은 [κΈ°μ—¬ν•˜κΈ° λ¬Έμ„œμ˜ `2-5. (λ‚΄ μ»΄ν“¨ν„°μ—μ„œ) κ²°κ³Ό ν™•μΈν•˜κΈ°`](https://github.com/PyTorchKorea/tutorials-kr/blob/master/CONTRIBUTING.md#2-5-λ‚΄-μ»΄ν“¨ν„°μ—μ„œ-κ²°κ³Ό-ν™•μΈν•˜κΈ°) 뢀뢄을 μ°Έκ³ ν•΄μ£Όμ„Έμš”.
4747

4848
---
49-
This is a project to translate [pytorch/tutorials@0918023](https://github.com/pytorch/tutorials/commit/091802395ed6cc5563643b6b6ef54ba99d412e66) into Korean.
49+
This is a project to translate [pytorch/tutorials@db34a77](https://github.com/pytorch/tutorials/commit/db34a779242f1a71346db4a9e5d6ac962a8d9b77) into Korean.
5050
For the latest version, please visit to the [official PyTorch tutorials repo](https://github.com/pytorch/tutorials).

β€Ž_static/css/custom.css

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/* sphinx-design styles for cards/tabs
2+
*/
3+
4+
:root {
5+
--sd-color-info: #ee4c2c;
6+
--sd-color-primary: #6c6c6d;
7+
--sd-color-primary-highlight: #f3f4f7;
8+
--sd-color-card-border-hover: #ee4c2c;
9+
--sd-color-card-border: #f3f4f7;
10+
--sd-color-card-background: #fff;
11+
--sd-color-card-text: inherit;
12+
--sd-color-card-header: transparent;
13+
--sd-color-card-footer: transparent;
14+
--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);
15+
--sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);
16+
--sd-color-tabs-label-inactive: hsl(0, 0%, 66%);
17+
--sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);
18+
--sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);
19+
--sd-color-tabs-underline-inactive: transparent;
20+
--sd-color-tabs-overline: rgb(222, 222, 222);
21+
--sd-color-tabs-underline: rgb(222, 222, 222);
22+
}
23+
24+
.sd-text-info {
25+
color: #ee4c2c;
26+
}
27+
28+
29+
.sd-card {
30+
position: relative;
31+
background-color: #fff;
32+
opacity: 1.0;
33+
border-radius: 0px;
34+
width: 30%;
35+
border: none;
36+
padding-bottom: 0px;
37+
}
38+
39+
40+
.sd-card-img {
41+
opacity: 0.5;
42+
width: 200px;
43+
padding: 0px;
44+
}
45+
46+
.sd-card-img:hover {
47+
opacity: 1.0;
48+
background-color: #f3f4f7;
49+
}
50+
51+
52+
.sd-card:after {
53+
display: block;
54+
opacity: 1;
55+
content: '';
56+
border-bottom: solid 1px #ee4c2c;
57+
background-color: #fff;
58+
transform: scaleX(0);
59+
transition: transform .250s ease-in-out;
60+
transform-origin: 0% 50%;
61+
}
62+
63+
.sd-card:hover {
64+
background-color: #fff;
65+
opacity: 1;
66+
border-top: 1px solid #f3f4f7;
67+
border-left: 1px solid #f3f4f7;
68+
border-right: 1px solid #f3f4f7;
69+
}
70+
71+
.sd-card:hover:after {
72+
transform: scaleX(1);
73+
}

0 commit comments

Comments
Β (0)