deal with a list of schedulers
@@ -289,12 +289,17 @@ class Transformer:
print(log_line)
accum_loss = 0
start = end
+ if optimizer:
if type(optimizer) == list:
for o in optimizer:
o.step()
else:
optimizer.step()
if scheduler:
+ if type(scheduler) == list:
+ for s in scheduler:
+ s.step()
+ else:
scheduler.step()
self.model.zero_grad()
