fix optimizer docs (#4084)

This commit is contained in:
Rohit Gupta 2020-10-12 00:24:53 +05:30 committed by GitHub
parent 079898fe82
commit 52870aa992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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