Update train_model_basic.rst (#15352)

This commit is contained in:
kimpty 2022-10-27 21:13:11 +08:00 committed by GitHub
parent 889fc50e8a
commit d956a123bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -116,11 +116,11 @@ Under the hood, the Lightning Trainer runs the following training loop on your b
.. code:: python
autoencoder = LitAutoEncoder(encoder, decoder)
autoencoder = LitAutoEncoder(Encoder(), Decoder())
optimizer = autoencoder.configure_optimizers()
for batch_idx, batch in enumerate(train_loader):
loss = autoencoder(batch, batch_idx)
loss = autoencoder.training_step(batch, batch_idx)
loss.backward()
optimizer.step()