Skip to content

Commit 93d6424

Browse files
fix deprecated usage ctx.saved_variables (pytorch#1076)
update **ctx.saved_variables** of `torch.autograd.Function` to **ctx.saved_tensors** Co-authored-by: holly1238 <[email protected]>
1 parent 061f101 commit 93d6424

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

advanced_source/cpp_extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ class citizens of PyTorch::
441441
@staticmethod
442442
def backward(ctx, grad_h, grad_cell):
443443
outputs = lltm_cpp.backward(
444-
grad_h.contiguous(), grad_cell.contiguous(), *ctx.saved_variables)
444+
grad_h.contiguous(), grad_cell.contiguous(), *ctx.saved_tensors)
445445
d_old_h, d_input, d_weights, d_bias, d_old_cell = outputs
446446
return d_input, d_weights, d_bias, d_old_h, d_old_cell
447447

0 commit comments

Comments
 (0)