Skip to content

Commit db48b10

Browse files
committed
Rebuild
1 parent 7fb5294 commit db48b10

File tree

206 files changed

+1547
-1447
lines changed

Some content is hidden

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

206 files changed

+1547
-1447
lines changed

โ€Ždocs/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: d3c78aee0796eaca17b472b08560486c
3+
config: 85edaa44f46a784d15b287d6d8ea99db
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

โ€Ždocs/_downloads/1ceade89aedc4c99a944f752a51c6d35/mario_rl_tutorial.ipynb

Lines changed: 27 additions & 27 deletions
Large diffs are not rendered by default.

โ€Ždocs/_downloads/934f425a64afc04a1466c778c945fb84/mario_rl_tutorial.py

Lines changed: 196 additions & 199 deletions
Large diffs are not rendered by default.

โ€Ždocs/_downloads/dba562a36c81e67ddf3b2f9503b7009b/super_resolution_with_onnxruntime.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
},
8181
"outputs": [],
8282
"source": [
83-
"# \ubaa8\ub378\uc5d0 \ub300\ud55c \uc785\ub825\uac12\nx = torch.randn(batch_size, 1, 224, 224, requires_grad=True)\ntorch_out = torch_model(x)\n\n# \ubaa8\ub378 \ubcc0\ud658\ntorch.onnx.export(torch_model, # \uc2e4\ud589\ub420 \ubaa8\ub378\n x, # \ubaa8\ub378 \uc785\ub825\uac12 (\ud29c\ud50c \ub610\ub294 \uc5ec\ub7ec \uc785\ub825\uac12\ub4e4\ub3c4 \uac00\ub2a5)\n \"super_resolution.onnx\", # \ubaa8\ub378 \uc800\uc7a5 \uacbd\ub85c (\ud30c\uc77c \ub610\ub294 \ud30c\uc77c\uacfc \uc720\uc0ac\ud55c \uac1d\uccb4 \ubaa8\ub450 \uac00\ub2a5)\n export_params=True, # \ubaa8\ub378 \ud30c\uc77c \uc548\uc5d0 \ud559\uc2b5\ub41c \ubaa8\ub378 \uac00\uc911\uce58\ub97c \uc800\uc7a5\ud560\uc9c0\uc758 \uc5ec\ubd80\n opset_version=10, # \ubaa8\ub378\uc744 \ubcc0\ud658\ud560 \ub54c \uc0ac\uc6a9\ud560 ONNX \ubc84\uc804\n do_constant_folding=True, # \ucd5c\uc801\ud558\uc2dc \uc0c1\uc218\ud3f4\ub529\uc744 \uc0ac\uc6a9\ud560\uc9c0\uc758 \uc5ec\ubd80\n input_names = ['input'], # \ubaa8\ub378\uc758 \uc785\ub825\uac12\uc744 \uac00\ub9ac\ud0a4\ub294 \uc774\ub984\n output_names = ['output'], # \ubaa8\ub378\uc758 \ucd9c\ub825\uac12\uc744 \uac00\ub9ac\ud0a4\ub294 \uc774\ub984\n dynamic_axes={'input' : {0 : 'batch_size'}, # \uac00\ubcc0\uc801\uc778 \uae38\uc774\ub97c \uac00\uc9c4 \ucc28\uc6d0\n 'output' : {0 : 'batch_size'}})"
83+
"# \ubaa8\ub378\uc5d0 \ub300\ud55c \uc785\ub825\uac12\nx = torch.randn(batch_size, 1, 224, 224, requires_grad=True)\ntorch_out = torch_model(x)\n\n# \ubaa8\ub378 \ubcc0\ud658\ntorch.onnx.export(torch_model, # \uc2e4\ud589\ub420 \ubaa8\ub378\n x, # \ubaa8\ub378 \uc785\ub825\uac12 (\ud29c\ud50c \ub610\ub294 \uc5ec\ub7ec \uc785\ub825\uac12\ub4e4\ub3c4 \uac00\ub2a5)\n \"super_resolution.onnx\", # \ubaa8\ub378 \uc800\uc7a5 \uacbd\ub85c (\ud30c\uc77c \ub610\ub294 \ud30c\uc77c\uacfc \uc720\uc0ac\ud55c \uac1d\uccb4 \ubaa8\ub450 \uac00\ub2a5)\n export_params=True, # \ubaa8\ub378 \ud30c\uc77c \uc548\uc5d0 \ud559\uc2b5\ub41c \ubaa8\ub378 \uac00\uc911\uce58\ub97c \uc800\uc7a5\ud560\uc9c0\uc758 \uc5ec\ubd80\n opset_version=10, # \ubaa8\ub378\uc744 \ubcc0\ud658\ud560 \ub54c \uc0ac\uc6a9\ud560 ONNX \ubc84\uc804\n do_constant_folding=True, # \ucd5c\uc801\ud654\uc2dc \uc0c1\uc218\ud3f4\ub529\uc744 \uc0ac\uc6a9\ud560\uc9c0\uc758 \uc5ec\ubd80\n input_names = ['input'], # \ubaa8\ub378\uc758 \uc785\ub825\uac12\uc744 \uac00\ub9ac\ud0a4\ub294 \uc774\ub984\n output_names = ['output'], # \ubaa8\ub378\uc758 \ucd9c\ub825\uac12\uc744 \uac00\ub9ac\ud0a4\ub294 \uc774\ub984\n dynamic_axes={'input' : {0 : 'batch_size'}, # \uac00\ubcc0\uc801\uc778 \uae38\uc774\ub97c \uac00\uc9c4 \ucc28\uc6d0\n 'output' : {0 : 'batch_size'}})"
8484
]
8585
},
8686
{

โ€Ždocs/_downloads/f6608f362ad07183c0ee305ce6aaa917/super_resolution_with_onnxruntime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _initialize_weights(self):
126126
"super_resolution.onnx", # ๋ชจ๋ธ ์ €์žฅ ๊ฒฝ๋กœ (ํŒŒ์ผ ๋˜๋Š” ํŒŒ์ผ๊ณผ ์œ ์‚ฌํ•œ ๊ฐ์ฒด ๋ชจ๋‘ ๊ฐ€๋Šฅ)
127127
export_params=True, # ๋ชจ๋ธ ํŒŒ์ผ ์•ˆ์— ํ•™์Šต๋œ ๋ชจ๋ธ ๊ฐ€์ค‘์น˜๋ฅผ ์ €์žฅํ• ์ง€์˜ ์—ฌ๋ถ€
128128
opset_version=10, # ๋ชจ๋ธ์„ ๋ณ€ํ™˜ํ•  ๋•Œ ์‚ฌ์šฉํ•  ONNX ๋ฒ„์ „
129-
do_constant_folding=True, # ์ตœ์ ํ•˜์‹œ ์ƒ์ˆ˜ํด๋”ฉ์„ ์‚ฌ์šฉํ• ์ง€์˜ ์—ฌ๋ถ€
129+
do_constant_folding=True, # ์ตœ์ ํ™”์‹œ ์ƒ์ˆ˜ํด๋”ฉ์„ ์‚ฌ์šฉํ• ์ง€์˜ ์—ฌ๋ถ€
130130
input_names = ['input'], # ๋ชจ๋ธ์˜ ์ž…๋ ฅ๊ฐ’์„ ๊ฐ€๋ฆฌํ‚ค๋Š” ์ด๋ฆ„
131131
output_names = ['output'], # ๋ชจ๋ธ์˜ ์ถœ๋ ฅ๊ฐ’์„ ๊ฐ€๋ฆฌํ‚ค๋Š” ์ด๋ฆ„
132132
dynamic_axes={'input' : {0 : 'batch_size'}, # ๊ฐ€๋ณ€์ ์ธ ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ฐจ์›
Loading

โ€Ždocs/_sources/index.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@
613613
.. customcalloutitem::
614614
:header: (๋น„๊ณต์‹) ํ•œ๊ตญ์–ด ํŠœํ† ๋ฆฌ์–ผ ์ €์žฅ์†Œ(GitHub)
615615
:description: GitHub์—์„œ (๋น„๊ณต์‹) ํ•œ๊ตญ์–ด ํŠœํ† ๋ฆฌ์–ผ์„ ๋งŒ๋‚˜๋ณด์„ธ์š”.
616-
:button_link: https://github.com/9bow/PyTorch-tutorials-kr
616+
:button_link: https://github.com/PyTorchKorea/tutorials-kr
617617
:button_text: Go To GitHub
618618

619619
.. customcalloutitem::

โ€Ždocs/_static/check-solid.svg

Lines changed: 4 additions & 0 deletions
Loading

โ€Ždocs/_static/clipboard.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

โ€Ždocs/_static/copy-button.svg

Lines changed: 1 addition & 1 deletion
Loading

โ€Ždocs/_static/copybutton.css

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,50 @@
11
/* Copy buttons */
2-
a.copybtn {
2+
button.copybtn {
33
position: absolute;
4-
top: .2em;
5-
right: .2em;
6-
width: 1em;
7-
height: 1em;
8-
opacity: .3;
9-
transition: opacity 0.5s;
10-
border: none;
4+
display: flex;
5+
top: .3em;
6+
right: .3em;
7+
width: 1.7em;
8+
height: 1.7em;
9+
opacity: 0;
10+
transition: opacity 0.3s, border .3s, background-color .3s;
1111
user-select: none;
12+
padding: 0;
13+
border: none;
14+
outline: none;
15+
border-radius: 0.4em;
16+
/* The colors that GitHub uses */
17+
border: #1b1f2426 1px solid;
18+
background-color: #f6f8fa;
19+
color: #57606a;
20+
}
21+
22+
button.copybtn.success {
23+
border-color: #22863a;
24+
color: #22863a;
25+
}
26+
27+
button.copybtn svg {
28+
stroke: currentColor;
29+
width: 1.5em;
30+
height: 1.5em;
31+
padding: 0.1em;
1232
}
1333

1434
div.highlight {
1535
position: relative;
1636
}
1737

18-
a.copybtn > img {
19-
vertical-align: top;
20-
margin: 0;
21-
top: 0;
22-
left: 0;
23-
position: absolute;
38+
.highlight:hover button.copybtn {
39+
opacity: 1;
2440
}
2541

26-
.highlight:hover .copybtn {
27-
opacity: 1;
42+
.highlight button.copybtn:hover {
43+
background-color: rgb(235, 235, 235);
44+
}
45+
46+
.highlight button.copybtn:active {
47+
background-color: rgb(187, 187, 187);
2848
}
2949

3050
/**
@@ -44,11 +64,10 @@ a.copybtn > img {
4464
visibility: hidden;
4565
position: absolute;
4666
content: attr(data-tooltip);
47-
padding: 2px;
48-
top: 0;
67+
padding: .2em;
68+
font-size: .8em;
4969
left: -.2em;
5070
background: grey;
51-
font-size: 1rem;
5271
color: white;
5372
white-space: nowrap;
5473
z-index: 2;
@@ -65,3 +84,10 @@ a.copybtn > img {
6584
transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
6685
transition-delay: .5s;
6786
}
87+
88+
/* By default the copy button shouldn't show up when printing a page */
89+
@media print {
90+
button.copybtn {
91+
display: none;
92+
}
93+
}

โ€Ždocs/_static/copybutton.js

Lines changed: 85 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,30 @@ const messages = {
1717
'copy_to_clipboard': 'In die Zwischenablage kopieren',
1818
'copy_success': 'Kopiert!',
1919
'copy_failure': 'Fehler beim Kopieren',
20+
},
21+
'fr' : {
22+
'copy': 'Copier',
23+
'copy_to_clipboard': 'Copiรฉ dans le presse-papier',
24+
'copy_success': 'Copiรฉ !',
25+
'copy_failure': 'ร‰chec de la copie',
26+
},
27+
'ru': {
28+
'copy': 'ะกะบะพะฟะธั€ะพะฒะฐั‚ัŒ',
29+
'copy_to_clipboard': 'ะกะบะพะฟะธั€ะพะฒะฐั‚ัŒ ะฒ ะฑัƒั„ะตั€',
30+
'copy_success': 'ะกะบะพะฟะธั€ะพะฒะฐะฝะพ!',
31+
'copy_failure': 'ะะต ัƒะดะฐะปะพััŒ ัะบะพะฟะธั€ะพะฒะฐั‚ัŒ',
32+
},
33+
'zh-CN': {
34+
'copy': 'ๅคๅˆถ',
35+
'copy_to_clipboard': 'ๅคๅˆถๅˆฐๅ‰ช่ดดๆฟ',
36+
'copy_success': 'ๅคๅˆถๆˆๅŠŸ!',
37+
'copy_failure': 'ๅคๅˆถๅคฑ่ดฅ',
38+
},
39+
'it' : {
40+
'copy': 'Copiare',
41+
'copy_to_clipboard': 'Copiato negli appunti',
42+
'copy_success': 'Copiato!',
43+
'copy_failure': 'Errore durante la copia',
2044
}
2145
}
2246

@@ -26,6 +50,31 @@ if( document.documentElement.lang !== undefined
2650
locale = document.documentElement.lang
2751
}
2852

53+
let doc_url_root = DOCUMENTATION_OPTIONS.URL_ROOT;
54+
if (doc_url_root == '#') {
55+
doc_url_root = '';
56+
}
57+
58+
/**
59+
* SVG files for our copy buttons
60+
*/
61+
let iconCheck = `<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-check" width="44" height="44" viewBox="0 0 24 24" stroke-width="2" stroke="#22863a" fill="none" stroke-linecap="round" stroke-linejoin="round">
62+
<title>${messages[locale]['copy_success']}</title>
63+
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
64+
<path d="M5 12l5 5l10 -10" />
65+
</svg>`
66+
67+
// If the user specified their own SVG use that, otherwise use the default
68+
let iconCopy = ``;
69+
if (!iconCopy) {
70+
iconCopy = `<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-copy" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="#000000" fill="none" stroke-linecap="round" stroke-linejoin="round">
71+
<title>${messages[locale]['copy_to_clipboard']}</title>
72+
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
73+
<rect x="8" y="8" width="12" height="12" rx="2" />
74+
<path d="M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2" />
75+
</svg>`
76+
}
77+
2978
/**
3079
* Set up copy/paste for code blocks
3180
*/
@@ -54,10 +103,17 @@ const clearSelection = () => {
54103
}
55104

56105
// Changes tooltip text for two seconds, then changes it back
57-
const temporarilyChangeTooltip = (el, newText) => {
58-
const oldText = el.getAttribute('data-tooltip')
106+
const temporarilyChangeTooltip = (el, oldText, newText) => {
59107
el.setAttribute('data-tooltip', newText)
108+
el.classList.add('success')
60109
setTimeout(() => el.setAttribute('data-tooltip', oldText), 2000)
110+
setTimeout(() => el.classList.remove('success'), 2000)
111+
}
112+
113+
// Changes the copy button icon for two seconds, then changes it back
114+
const temporarilyChangeIcon = (el) => {
115+
el.innerHTML = iconCheck;
116+
setTimeout(() => {el.innerHTML = iconCopy}, 2000)
61117
}
62118

63119
const addCopyButtonToCodeCells = () => {
@@ -73,12 +129,11 @@ const addCopyButtonToCodeCells = () => {
73129
codeCells.forEach((codeCell, index) => {
74130
const id = codeCellId(index)
75131
codeCell.setAttribute('id', id)
76-
const pre_bg = getComputedStyle(codeCell).backgroundColor;
77132

78133
const clipboardButton = id =>
79-
`<a class="copybtn o-tooltip--left" style="background-color: ${pre_bg}" data-tooltip="${messages[locale]['copy']}" data-clipboard-target="#${id}">
80-
<img src="${DOCUMENTATION_OPTIONS.URL_ROOT}_static/copy-button.svg" alt="${messages[locale]['copy_to_clipboard']}">
81-
</a>`
134+
`<button class="copybtn o-tooltip--left" data-tooltip="${messages[locale]['copy']}" data-clipboard-target="#${id}">
135+
${iconCopy}
136+
</button>`
82137
codeCell.insertAdjacentHTML('afterend', clipboardButton(id))
83138
})
84139

@@ -88,11 +143,15 @@ function escapeRegExp(string) {
88143

89144
// Callback when a copy button is clicked. Will be passed the node that was clicked
90145
// should then grab the text and replace pieces of text that shouldn't be used in output
91-
function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true) {
146+
function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") {
92147

93148
var regexp;
94149
var match;
95150

151+
// Do we check for line continuation characters and "HERE-documents"?
152+
var useLineCont = !!lineContinuationChar
153+
var useHereDoc = !!hereDocDelim
154+
96155
// create regexp to capture prompt and remaining line
97156
if (isRegexp) {
98157
regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)')
@@ -102,24 +161,31 @@ function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onl
102161

103162
const outputLines = [];
104163
var promptFound = false;
164+
var gotLineCont = false;
165+
var gotHereDoc = false;
166+
const lineGotPrompt = [];
105167
for (const line of textContent.split('\n')) {
106168
match = line.match(regexp)
107-
if (match) {
108-
promptFound = true
109-
if (removePrompts) {
169+
if (match || gotLineCont || gotHereDoc) {
170+
promptFound = regexp.test(line)
171+
lineGotPrompt.push(promptFound)
172+
if (removePrompts && promptFound) {
110173
outputLines.push(match[2])
111174
} else {
112175
outputLines.push(line)
113176
}
114-
} else {
115-
if (!onlyCopyPromptLines) {
116-
outputLines.push(line)
117-
}
177+
gotLineCont = line.endsWith(lineContinuationChar) & useLineCont
178+
if (line.includes(hereDocDelim) & useHereDoc)
179+
gotHereDoc = !gotHereDoc
180+
} else if (!onlyCopyPromptLines) {
181+
outputLines.push(line)
182+
} else if (copyEmptyLines && line.trim() === '') {
183+
outputLines.push(line)
118184
}
119185
}
120186

121187
// If no lines with the prompt were found then just use original lines
122-
if (promptFound) {
188+
if (lineGotPrompt.some(v => v === true)) {
123189
textContent = outputLines.join('\n');
124190
}
125191

@@ -133,7 +199,7 @@ function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onl
133199

134200
var copyTargetText = (trigger) => {
135201
var target = document.querySelector(trigger.attributes['data-clipboard-target'].value);
136-
return formatCopyText(target.innerText, '', false, true, true)
202+
return formatCopyText(target.innerText, '', false, true, true, true, '', '')
137203
}
138204

139205
// Initialize with a callback so we can modify the text before copy
@@ -142,11 +208,12 @@ var copyTargetText = (trigger) => {
142208
// Update UI with error/success messages
143209
clipboard.on('success', event => {
144210
clearSelection()
145-
temporarilyChangeTooltip(event.trigger, messages[locale]['copy_success'])
211+
temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_success'])
212+
temporarilyChangeIcon(event.trigger)
146213
})
147214

148215
clipboard.on('error', event => {
149-
temporarilyChangeTooltip(event.trigger, messages[locale]['copy_failure'])
216+
temporarilyChangeTooltip(event.trigger, messages[locale]['copy'], messages[locale]['copy_failure'])
150217
})
151218
}
152219

โ€Ždocs/_static/copybutton_funcs.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ function escapeRegExp(string) {
44

55
// Callback when a copy button is clicked. Will be passed the node that was clicked
66
// should then grab the text and replace pieces of text that shouldn't be used in output
7-
export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true) {
7+
export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") {
88

99
var regexp;
1010
var match;
1111

12+
// Do we check for line continuation characters and "HERE-documents"?
13+
var useLineCont = !!lineContinuationChar
14+
var useHereDoc = !!hereDocDelim
15+
1216
// create regexp to capture prompt and remaining line
1317
if (isRegexp) {
1418
regexp = new RegExp('^(' + copybuttonPromptText + ')(.*)')
@@ -18,24 +22,31 @@ export function formatCopyText(textContent, copybuttonPromptText, isRegexp = fal
1822

1923
const outputLines = [];
2024
var promptFound = false;
25+
var gotLineCont = false;
26+
var gotHereDoc = false;
27+
const lineGotPrompt = [];
2128
for (const line of textContent.split('\n')) {
2229
match = line.match(regexp)
23-
if (match) {
24-
promptFound = true
25-
if (removePrompts) {
30+
if (match || gotLineCont || gotHereDoc) {
31+
promptFound = regexp.test(line)
32+
lineGotPrompt.push(promptFound)
33+
if (removePrompts && promptFound) {
2634
outputLines.push(match[2])
2735
} else {
2836
outputLines.push(line)
2937
}
30-
} else {
31-
if (!onlyCopyPromptLines) {
32-
outputLines.push(line)
33-
}
38+
gotLineCont = line.endsWith(lineContinuationChar) & useLineCont
39+
if (line.includes(hereDocDelim) & useHereDoc)
40+
gotHereDoc = !gotHereDoc
41+
} else if (!onlyCopyPromptLines) {
42+
outputLines.push(line)
43+
} else if (copyEmptyLines && line.trim() === '') {
44+
outputLines.push(line)
3445
}
3546
}
3647

3748
// If no lines with the prompt were found then just use original lines
38-
if (promptFound) {
49+
if (lineGotPrompt.some(v => v === true)) {
3950
textContent = outputLines.join('\n');
4051
}
4152

0 commit comments

Comments
ย (0)