Skip to content

Commit c91a69b

Browse files
authored
Merge branch 'main' into update_cpp_rocm
2 parents eef2e09 + 08a9bcd commit c91a69b

File tree

9 files changed

+132
-69
lines changed

9 files changed

+132
-69
lines changed
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#Runs once a month and checks links in the repo to ensure they are valid
2+
#If action fails, it creates an issue with the failing links and an "incorrect link" label
3+
#If link is valid but failing, it can be added to the .lycheeignore file
4+
#Action can also be run manually as needed.
5+
6+
7+
name: Monthly Link Check
8+
on:
9+
schedule:
10+
- cron: '0 0 1 * *' # Runs at midnight on the first day of every month
11+
workflow_dispatch: # Allows manual triggering of the workflow
12+
jobs:
13+
linkChecker:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 1
21+
- name: Check Links
22+
id: lychee
23+
uses: lycheeverse/lychee-action@v2
24+
with:
25+
args: --accept=200,403,429 --base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'
26+
token: ${{ secrets.CUSTOM_TOKEN }}
27+
fail: true
28+
29+
- name: Create Issue From File
30+
if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
31+
uses: peter-evans/create-issue-from-file@v5
32+
with:
33+
title: Broken links detected in docs 🔗
34+
content-filepath: ./lychee/out.md
35+
labels: 'incorrect link'
36+
#token: ${{ secrets.CUSTOM_TOKEN }}
37+
38+
39+
- name: Suggestions
40+
if: failure()
41+
run: |
42+
echo -e "\nPlease review the links reported in the Check links step above."
43+
echo -e "If a link is valid but fails due to a CAPTCHA challenge, IP blocking, login requirements, etc., consider adding such links to .lycheeignore file to bypass future checks.\n"
44+
exit 1

.github/workflows/link_checkPR.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Get Changed Files
2020
id: changed-files
21-
uses: tj-actions/changed-files@v41
21+
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
2222

2323
- name: Check for Skip Label
2424
id: skip-label

.jenkins/post_process_notebooks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
# Pattern to search ``` {.python .jupyter-code-cell}
15-
pattern = re.compile(r'(.*?)``` {.python .jupyter-code-cell}\n\n(from IPython.display import display, HTML\nhtml_code = """\n.*?\n"""\ndisplay\(HTML\(html_code\)\))\n```(.*)', re.DOTALL)
15+
pattern = re.compile(r'(.*?)``` {\.python \.jupyter-code-cell}\n(.*?from IPython\.display import display, HTML.*?display\(HTML\(html_code\)\))\n```(.*)', re.DOTALL)
1616

1717

1818
def process_video_cell(notebook_path):

_templates/layout.html

+16-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{
2525
var div = '<div class="admonition note"><p class="admonition-title">Note</p><p><i class="fa fa-flask" aria-hidden="true">&nbsp</i> This tutorial describes a prototype feature. Prototype features are typically not available as part of binary distributions like PyPI or Conda, except sometimes behind run-time flags, and are at an early stage for feedback and testing.</p></div>'
2626
document.getElementById("pytorch-article").insertAdjacentHTML('afterBegin', div)
27-
}
27+
}
2828
</script>
2929
{%- endblock %}
3030

@@ -102,9 +102,9 @@
102102
if (googleSearchboxText) {
103103
googleSearchboxText.placeholder = placeholderText;
104104
googleSearchboxText.style.fontFamily = 'FreightSans';
105-
googleSearchboxText.style.fontSize = "1.2rem";
105+
googleSearchboxText.style.fontSize = "1.2rem";
106106
googleSearchboxText.style.color = '#262626';
107-
}
107+
}
108108
};
109109
});
110110
</script>
@@ -114,7 +114,7 @@
114114
{{ super() }}
115115
<script>
116116

117-
// Helper function to make it easier to call dataLayer.push()
117+
// Helper function to make it easier to call dataLayer.push()
118118
function gtag(){window.dataLayer.push(arguments);}
119119

120120
//add microsoft link
@@ -148,7 +148,7 @@
148148
case"saveloadrun_tutorial":
149149
url="https://docs.microsoft.com/learn/modules/intro-machine-learning-pytorch/8-inference?WT.mc_id=aiml-7486-cxa";
150150
}
151-
151+
152152
$(".pytorch-call-to-action-links").children().first().before("<a href="+url+' data-behavior="call-to-action-event" data-response="Run in Microsoft Learn" target="_blank"><div id="microsoft-learn-link" style="padding-bottom: 0.625rem;border-bottom: 1px solid #f3f4f7;padding-right: 2.5rem;display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center;-ms-flex-align: center;align-items: center;"><img class="call-to-action-img" src="../../_static/images/microsoft-logo.svg"/><div class="call-to-action-desktop-view">Run in Microsoft Learn</div><div class="call-to-action-mobile-view">Learn</div></div></a>')
153153
}
154154

@@ -210,4 +210,15 @@
210210
</script>
211211

212212
<img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/795629140/?label=txkmCPmdtosBENSssfsC&amp;guid=ON&amp;script=0"/>
213+
214+
//temporarily add a link to survey
215+
<script>
216+
var survey = '<div class="survey-banner"><p><i class="fas fa-poll" aria-hidden="true">&nbsp </i> Take the <a href="https://forms.gle/KZ4xGL65VRMYNbbG6">PyTorch Docs/Tutorials survey</a>.</p></div>'
217+
if ($(".pytorch-call-to-action-links").length) {
218+
$(".pytorch-call-to-action-links").before(survey);
219+
} else {
220+
$("#pytorch-article").prepend(survey);
221+
}
222+
</script>
223+
213224
{% endblock %}

advanced_source/python_custom_ops.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ def crop(pic: torch.Tensor, box: Sequence[int]) -> torch.Tensor:
112112
def _(pic, box):
113113
channels = pic.shape[0]
114114
x0, y0, x1, y1 = box
115-
return pic.new_empty(channels, y1 - y0, x1 - x0)
115+
result = pic.new_empty(y1 - y0, x1 - x0, channels).permute(2, 0, 1)
116+
# The result should have the same metadata (shape/strides/``dtype``/device)
117+
# as running the ``crop`` function above.
118+
return result
116119

117120
######################################################################
118121
# After this, ``crop`` now works without graph breaks:

beginner_source/data_loading_tutorial.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def show_landmarks_batch(sample_batched):
445445
# from torchvision import transforms, datasets
446446
#
447447
# data_transform = transforms.Compose([
448-
# transforms.RandomSizedCrop(224),
448+
# transforms.RandomResizedCrop(224),
449449
# transforms.RandomHorizontalFlip(),
450450
# transforms.ToTensor(),
451451
# transforms.Normalize(mean=[0.485, 0.456, 0.406],

beginner_source/introyt/introyt_index.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""
2-
`Introduction <introyt/introyt1_tutorial.html>`_ ||
3-
`Tensors <introyt/tensors_deeper_tutorial.html>`_ ||
4-
`Autograd <introyt/autogradyt_tutorial.html>`_ ||
5-
`Building Models <introyt/modelsyt_tutorial.html>`_ ||
6-
`TensorBoard Support <introyt/tensorboardyt_tutorial.html>`_ ||
7-
`Training Models <introyt/trainingyt.html>`_ ||
8-
`Model Understanding <introyt/captumyt.html>`_
2+
`Introduction <introyt1_tutorial.html>`_ ||
3+
`Tensors <tensors_deeper_tutorial.html>`_ ||
4+
`Autograd <autogradyt_tutorial.html>`_ ||
5+
`Building Models <modelsyt_tutorial.html>`_ ||
6+
`TensorBoard Support <tensorboardyt_tutorial.html>`_ ||
7+
`Training Models <trainingyt.html>`_ ||
8+
`Model Understanding <captumyt.html>`_
99
1010
Introduction to PyTorch - YouTube Series
1111
========================================

0 commit comments

Comments
 (0)