Skip to content

Commit 7d58765

Browse files
yeelan0319soumith
authored andcommitted
docs: Fixed example code bug in extending module doc.
1 parent 76f7d74 commit 7d58765

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/source/notes/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ This is how a ``Linear`` module can be implemented::
132132
# nn.Parameters can never be volatile and, different than Variables,
133133
# they require gradients by default.
134134
self.weight = nn.Parameter(torch.Tensor(input_features, output_features))
135-
if bias is not None:
135+
if bias:
136136
self.bias = nn.Parameter(torch.Tensor(output_features))
137137
else:
138138
# You should always register all possible parameters, but the

0 commit comments

Comments
 (0)