Skip to content

Commit 2016371

Browse files
committed
Automated tutorials push
1 parent ebfed25 commit 2016371

File tree

234 files changed

+41891
-29289
lines changed

Some content is hidden

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

234 files changed

+41891
-29289
lines changed

_downloads/3195443a0ced3cabc0ad643537bdb5cd/introyt1_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{
3535
"cell_type": "code",
3636
"execution_count": null,
37-
"id": "1452bf59",
37+
"id": "d0a7147b",
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "1a321387",
53+
"id": "7f58a882",
5454
"metadata": {},
5555
"source": [
5656
"\n",

_downloads/4355e2cef7d17548f1e25f97a62828c4/template_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
{
3232
"cell_type": "code",
3333
"execution_count": null,
34-
"id": "6e012bbf",
34+
"id": "53a67736",
3535
"metadata": {},
3636
"outputs": [],
3737
"source": [
@@ -47,7 +47,7 @@
4747
},
4848
{
4949
"cell_type": "markdown",
50-
"id": "a937745f",
50+
"id": "20324c00",
5151
"metadata": {},
5252
"source": [
5353
"\n",

_downloads/63a0f0fc7b3ffb15d3a5ac8db3d521ee/tensors_deeper_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{
3535
"cell_type": "code",
3636
"execution_count": null,
37-
"id": "2cd7970b",
37+
"id": "e70bac24",
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "a5cd3c6f",
53+
"id": "5652b2b3",
5454
"metadata": {},
5555
"source": [
5656
"\n",

_downloads/74b90fda9cec339519e5ef764956100f/profiler_recipe.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,20 @@
163163
# Note the occurrence of ``aten::convolution`` twice with different input shapes.
164164

165165
######################################################################
166-
# Profiler can also be used to analyze performance of models executed on GPUs and XPUs:
166+
# Profiler can also be used to analyze performance of models executed on GPUs:
167167
# Users could switch between cpu, cuda and xpu
168+
activities = [ProfilerActivity.CPU]
168169
if torch.cuda.is_available():
169170
device = 'cuda'
171+
activities += [ProfilerActivity.CUDA]
170172
elif torch.xpu.is_available():
171173
device = 'xpu'
174+
activities += [ProfilerActivity.XPU]
172175
else:
173176
print('Neither CUDA nor XPU devices are available to demonstrate profiling on acceleration devices')
174177
import sys
175178
sys.exit(0)
176179

177-
activities = [ProfilerActivity.CPU, ProfilerActivity.CUDA, ProfilerActivity.XPU]
178180
sort_by_keyword = device + "_time_total"
179181

180182
model = models.resnet18().to(device)
@@ -308,9 +310,17 @@
308310
# Profiling results can be outputted as a ``.json`` trace file:
309311
# Tracing CUDA or XPU kernels
310312
# Users could switch between cpu, cuda and xpu
311-
device = 'cuda'
312-
313-
activities = [ProfilerActivity.CPU, ProfilerActivity.CUDA, ProfilerActivity.XPU]
313+
activities = [ProfilerActivity.CPU]
314+
if torch.cuda.is_available():
315+
device = 'cuda'
316+
activities += [ProfilerActivity.CUDA]
317+
elif torch.xpu.is_available():
318+
device = 'xpu'
319+
activities += [ProfilerActivity.XPU]
320+
else:
321+
print('Neither CUDA nor XPU devices are available to demonstrate profiling on acceleration devices')
322+
import sys
323+
sys.exit(0)
314324

315325
model = models.resnet18().to(device)
316326
inputs = torch.randn(5, 3, 224, 224).to(device)

_downloads/770632dd3941d2a51b831c52ded57aa2/trainingyt.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{
3636
"cell_type": "code",
3737
"execution_count": null,
38-
"id": "aa26c931",
38+
"id": "2188aef8",
3939
"metadata": {},
4040
"outputs": [],
4141
"source": [
@@ -51,7 +51,7 @@
5151
},
5252
{
5353
"cell_type": "markdown",
54-
"id": "d5bd28d2",
54+
"id": "648d5416",
5555
"metadata": {},
5656
"source": [
5757
"\n",

_downloads/b2c9c15033f17c2bdf31c864f9d39c76/profiler_recipe.ipynb

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270
"metadata": {},
271271
"source": [
272272
"Profiler can also be used to analyze performance of models executed on\n",
273-
"GPUs and XPUs: Users could switch between cpu, cuda and xpu\n"
273+
"GPUs: Users could switch between cpu, cuda and xpu\n"
274274
]
275275
},
276276
{
@@ -281,16 +281,18 @@
281281
},
282282
"outputs": [],
283283
"source": [
284+
"activities = [ProfilerActivity.CPU]\n",
284285
"if torch.cuda.is_available():\n",
285286
" device = 'cuda'\n",
287+
" activities += [ProfilerActivity.CUDA]\n",
286288
"elif torch.xpu.is_available():\n",
287289
" device = 'xpu'\n",
290+
" activities += [ProfilerActivity.XPU]\n",
288291
"else:\n",
289292
" print('Neither CUDA nor XPU devices are available to demonstrate profiling on acceleration devices')\n",
290293
" import sys\n",
291294
" sys.exit(0)\n",
292295
"\n",
293-
"activities = [ProfilerActivity.CPU, ProfilerActivity.CUDA, ProfilerActivity.XPU]\n",
294296
"sort_by_keyword = device + \"_time_total\"\n",
295297
"\n",
296298
"model = models.resnet18().to(device)\n",
@@ -473,9 +475,17 @@
473475
},
474476
"outputs": [],
475477
"source": [
476-
"device = 'cuda'\n",
477-
"\n",
478-
"activities = [ProfilerActivity.CPU, ProfilerActivity.CUDA, ProfilerActivity.XPU]\n",
478+
"activities = [ProfilerActivity.CPU]\n",
479+
"if torch.cuda.is_available():\n",
480+
" device = 'cuda'\n",
481+
" activities += [ProfilerActivity.CUDA]\n",
482+
"elif torch.xpu.is_available():\n",
483+
" device = 'xpu'\n",
484+
" activities += [ProfilerActivity.XPU]\n",
485+
"else:\n",
486+
" print('Neither CUDA nor XPU devices are available to demonstrate profiling on acceleration devices')\n",
487+
" import sys\n",
488+
" sys.exit(0)\n",
479489
"\n",
480490
"model = models.resnet18().to(device)\n",
481491
"inputs = torch.randn(5, 3, 224, 224).to(device)\n",

_downloads/c28f42852d456daf9af72da6c6909556/captumyt.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{
3838
"cell_type": "code",
3939
"execution_count": null,
40-
"id": "fc24ebb9",
40+
"id": "4ac4e0be",
4141
"metadata": {},
4242
"outputs": [],
4343
"source": [
@@ -53,7 +53,7 @@
5353
},
5454
{
5555
"cell_type": "markdown",
56-
"id": "ba61b37d",
56+
"id": "641de0c3",
5757
"metadata": {},
5858
"source": [
5959
"\n",

_downloads/e2e556f6b4693c2cef716dd7f40caaf6/tensorboardyt_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{
3636
"cell_type": "code",
3737
"execution_count": null,
38-
"id": "fff599ca",
38+
"id": "04c41588",
3939
"metadata": {},
4040
"outputs": [],
4141
"source": [
@@ -51,7 +51,7 @@
5151
},
5252
{
5353
"cell_type": "markdown",
54-
"id": "7e75bfb3",
54+
"id": "3743fb51",
5555
"metadata": {},
5656
"source": [
5757
"\n",

_downloads/ed9d4f94afb79f7dada6742a06c486a5/autogradyt_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{
3535
"cell_type": "code",
3636
"execution_count": null,
37-
"id": "8dfc30fd",
37+
"id": "875759f4",
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "39a1a7a5",
53+
"id": "cb03fcb6",
5454
"metadata": {},
5555
"source": [
5656
"\n",

_downloads/fe726e041160526cf828806536922cf6/modelsyt_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{
3535
"cell_type": "code",
3636
"execution_count": null,
37-
"id": "2f61dc95",
37+
"id": "2aaffb92",
3838
"metadata": {},
3939
"outputs": [],
4040
"source": [
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "markdown",
53-
"id": "b85e8134",
53+
"id": "c4828e1c",
5454
"metadata": {},
5555
"source": [
5656
"\n",

0 commit comments

Comments
 (0)