Skip to content

Commit 28f28d8

Browse files
committed
fix
1 parent 5e5a2b7 commit 28f28d8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

beginner_source/examples_nn/dynamic_net.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
class DynamicNet(torch.nn.Module):
1717
def __init__(self):
1818
"""
19-
In the constructor we instantiate four parameters and assign them as
20-
member variables.
19+
In the constructor we instantiate five parameters and assign them as members.
2120
"""
2221
super().__init__()
2322
self.a = torch.nn.Parameter(torch.randn(()))
@@ -35,9 +34,8 @@ def forward(self, x):
3534
Python control-flow operators like loops or conditional statements when
3635
defining the forward pass of the model.
3736
38-
Here we also see that it is perfectly safe to reuse the same Module many
39-
times when defining a computational graph. This is a big improvement from Lua
40-
Torch, where each Module could be used only once.
37+
Here we also see that it is perfectly safe to reuse the same parameter many
38+
times when defining a computational graph.
4139
"""
4240
y = self.a + self.b * x + self.c * x ** 2 + self.d * x ** 3
4341
for exp in range(4, random.randint(4, 6)):

0 commit comments

Comments
 (0)