-
Notifications
You must be signed in to change notification settings - Fork 4.1k
/
Copy pathtemplate_tutorial.py
94 lines (71 loc) · 2.44 KB
/
template_tutorial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- coding: utf-8 -*-
"""
Template Tutorial
=================
**Author:** `FirstName LastName <https://github.com/username>`_
.. grid:: 2
.. grid-item-card:: :octicon:`mortar-board;1em;` What you will learn
:class-card: card-prerequisites
* Item 1
* Item 2
* Item 3
.. grid-item-card:: :octicon:`list-unordered;1em;` Prerequisites
:class-card: card-prerequisites
* PyTorch v2.0.0
* GPU ???
* Other items 3
If you have a video, add it here like this:
.. raw:: html
<div style="margin-top:10px; margin-bottom:10px;">
<iframe width="560" height="315" src="https://www.youtube.com/embed/IC0_FRiX-sw" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
To test your tutorial locally, you can do one of the following:
* You can control specific files that generate the results by using
``GALLERY_PATTERN`` environment variable. The GALLERY_PATTERN variable
respects regular expressions.
For example to run only ``neural_style_transfer_tutorial.py``,
use the following command:
.. code-block:: sh
GALLERY_PATTERN="neural_style_transfer_tutorial.py" make html
or
.. code-block:: sh
GALLERY_PATTERN="neural_style_transfer_tutorial.py" sphinx-build . _build
* Make a copy of this repository and add only your
tutorial to the `beginner_source` directory removing all other tutorials.
Then run ``make html``.
Verify that all outputs were generated correctly in the created HTML.
"""
#########################################################################
# Overview
# --------
#
# Describe Why is this topic important? Add Links to relevant research papers.
#
# This tutorial walks you through the process of....
#
# Steps
# -----
#
# Example code (the output below is generated automatically):
#
import torch
x = torch.rand(5, 3)
print(x)
######################################################################
# (Optional) Additional Exercises
# -------------------------------
#
# Add additional practice exercises for users to test their knowledge.
# Example: `NLP from Scratch <https://pytorch.org/tutorials/intermediate/char_rnn_generation_tutorial.html#exercises>`__.
#
######################################################################
# Conclusion
# ----------
#
# Summarize the steps and concepts covered. Highlight key takeaways.
#
# Further Reading
# ---------------
#
# * Link1
# * Link2