Fabric docs feedback 2/n (#16480)
This commit is contained in:
parent
405bb75553
commit
bb7b8d601a
|
@ -100,10 +100,10 @@ It is up to you to call everything at the right place.
|
|||
model.train()
|
||||
for epoch in range(num_epochs):
|
||||
for i, batch in enumerate(dataloader):
|
||||
optimizer.zero_grad()
|
||||
loss = model.training_step(batch, i)
|
||||
fabric.backward(loss)
|
||||
optimizer.step()
|
||||
optimizer.zero_grad()
|
||||
|
||||
# Control when hooks are called
|
||||
if condition:
|
||||
|
|
|
@ -77,7 +77,6 @@ def run(hparams):
|
|||
# by the command line. See all options: `lightning run model --help`
|
||||
fabric = Fabric()
|
||||
|
||||
fabric.hparams = hparams
|
||||
seed_everything(hparams.seed) # instead of torch.manual_seed(...)
|
||||
|
||||
transform = T.Compose([T.ToTensor(), T.Normalize((0.1307,), (0.3081,))])
|
||||
|
|
Loading…
Reference in New Issue