From 52870aa992008301a58387b24d63e2b8c6b848c7 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Mon, 12 Oct 2020 00:24:53 +0530 Subject: [PATCH] fix optimizer docs (#4084) --- docs/source/optimizers.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/optimizers.rst b/docs/source/optimizers.rst index f2380fdb91..a8fbd202be 100644 --- a/docs/source/optimizers.rst +++ b/docs/source/optimizers.rst @@ -43,9 +43,9 @@ to manually manage the optimization process. To do so, do the following: # pass in any args that loss.backward() normally takes self.manual_backward(loss_b, opt_d, retain_graph=True) - self.manual_backward(loss_b, opt_d, retain_graph=True) - loss_b.step() - loss_b.zero_grad() + self.manual_backward(loss_b, opt_d) + opt_d.step() + opt_d.zero_grad() .. note:: This is only recommended for experts who need ultimate flexibility