Skip to content

Commit 250f741

Browse files
authored
Update autograd_tutorial.py (#1787)
Fixed link and note
1 parent cc9d6ad commit 250f741

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

beginner_source/blitz/autograd_tutorial.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232
3333
3434
Usage in PyTorch
35-
~~~~~~~~~~~
35+
~~~~~~~~~~~~~~~~
3636
Let's take a look at a single training step.
3737
For this example, we load a pretrained resnet18 model from ``torchvision``.
3838
We create a random data tensor to represent a single image with 3 channels, and height & width of 64,
3939
and its corresponding ``label`` initialized to some random values. Label in pretrained models has
4040
shape (1,1000).
4141
42-
Important
43-
~~~~~~~~~~~
44-
This tutorial work only on CPU and will not work on GPU (even if tensor are moved to CUDA).
42+
.. note::
43+
This tutorial work only on CPU and will not work on GPU (even if tensor are moved to CUDA).
44+
4545
"""
4646
import torch, torchvision
4747
model = torchvision.models.resnet18(pretrained=True)
@@ -66,7 +66,7 @@
6666
loss.backward() # backward pass
6767

6868
############################################################
69-
# Next, we load an optimizer, in this case SGD with a learning rate of 0.01 and [momentum](https://towardsdatascience.com/stochastic-gradient-descent-with-momentum-a84097641a5d) of 0.9.
69+
# Next, we load an optimizer, in this case SGD with a learning rate of 0.01 and `momentum <https://towardsdatascience.com/stochastic-gradient-descent-with-momentum-a84097641a5d>`__ of 0.9.
7070
# We register all the parameters of the model in the optimizer.
7171
#
7272

0 commit comments

Comments
 (0)