def zero_grad(self):
    self.loss = 0.0
    self.losses = []
    for (model, optimizer) in zip(self.models, self.optimizers):
        model.train()
        optimizer.zero_grad()
def zero_grad(self):
    self.loss = 0.0
    self.losses = []
    for (model, optimizer) in zip(self.models, self.optimizers):
        model.train()
        optimizer.zero_grad()