Skip to content

Commit bd8361c

Browse files
authored
Merge pull request #403 from pytorch/cppext-fix
fix c++ extensions tutorial
2 parents 9e7ebc0 + c2204d8 commit bd8361c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

advanced_source/cpp_extension.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ class citizens of PyTorch::
428428
def forward(ctx, input, weights, bias, old_h, old_cell):
429429
outputs = lltm.forward(input, weights, bias, old_h, old_cell)
430430
new_h, new_cell = outputs[:2]
431-
variables = outputs[1:] + [weights, old_cell]
431+
variables = outputs[1:] + [weights]
432432
ctx.save_for_backward(*variables)
433433

434434
return new_h, new_cell
@@ -437,7 +437,7 @@ class citizens of PyTorch::
437437
def backward(ctx, grad_h, grad_cell):
438438
outputs = lltm.backward(
439439
grad_h.contiguous(), grad_cell.contiguous(), *ctx.saved_variables)
440-
d_old_h, d_input, d_weights, d_bias, d_old_cell, d_gates = outputs
440+
d_old_h, d_input, d_weights, d_bias, d_old_cell = outputs
441441
return d_input, d_weights, d_bias, d_old_h, d_old_cell
442442

443443

0 commit comments

Comments
 (0)