Skip to content

Commit 9f11126

Browse files
author
Svetlana Karslioglu
authored
Merge branch 'main' into svekars-patch-3
2 parents 1d9c92b + 3444865 commit 9f11126

File tree

4 files changed

+95
-234
lines changed

4 files changed

+95
-234
lines changed

advanced_source/cpp_frontend.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,9 +946,9 @@ we use implement the `Adam <https://arxiv.org/pdf/1412.6980.pdf>`_ algorithm:
946946
.. code-block:: cpp
947947
948948
torch::optim::Adam generator_optimizer(
949-
generator->parameters(), torch::optim::AdamOptions(2e-4).beta1(0.5));
949+
generator->parameters(), torch::optim::AdamOptions(2e-4).betas(std::make_tuple(0.5, 0.5)));
950950
torch::optim::Adam discriminator_optimizer(
951-
discriminator->parameters(), torch::optim::AdamOptions(5e-4).beta1(0.5));
951+
discriminator->parameters(), torch::optim::AdamOptions(5e-4).betas(std::make_tuple(0.5, 0.5)));
952952
953953
.. note::
954954

beginner_source/template_tutorial.py

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

prototype_source/fx_numeric_suite_tutorial.py

Lines changed: 0 additions & 231 deletions
This file was deleted.

recipes_source/recipes/saving_and_loading_a_general_checkpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def forward(self, x):
129129
#
130130

131131
model = Net()
132-
optimizer = optim.SGD(net.parameters(), lr=0.001, momentum=0.9)
132+
optimizer = optim.SGD(model.parameters(), lr=0.001, momentum=0.9)
133133

134134
checkpoint = torch.load(PATH)
135135
model.load_state_dict(checkpoint['model_state_dict'])

0 commit comments

Comments
 (0)