Skip to content

Commit

Permalink
Fix incorrect code-snippet in optimizers doc (#7598)
Browse files Browse the repository at this point in the history
`training_step(...)` should take `self` as the first argument. It's a simple but necessary fix.
  • Loading branch information
theblackfly authored May 19, 2021
1 parent 76ff600 commit 922c0a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/common/optimizers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Here is a minimal example of manual optimization.
# Important: This property activates manual optimization.
self.automatic_optimization = False

def training_step(batch, batch_idx):
def training_step(self, batch, batch_idx):
opt = self.optimizers()
opt.zero_grad()
loss = self.compute_loss(batch)
Expand Down

0 comments on commit 922c0a6

Please sign in to comment.