def on_train_epoch_start(self, epoch):
    self.trainer.current_epoch = epoch
    model = self.trainer.lightning_module
    if ((epoch != 0) and self.trainer.reload_dataloaders_every_epoch):
        self.trainer.reset_train_dataloader(model)
    with suppress(Exception):
        self.trainer.train_dataloader.sampler.set_epoch(epoch)
    self.trainer.accumulation_scheduler.on_train_epoch_start(self.trainer, self.trainer.lightning_module)
    self.accumulated_loss = TensorRunningAccum(window_length=self.trainer.accumulate_grad_batches)
    self.trainer.call_hook('on_epoch_start')
    self.trainer.call_hook('on_train_epoch_start')
def on_train_epoch_start(self, epoch):
    self.trainer.current_epoch = epoch
    model = self.trainer.lightning_module
    if ((epoch != 0) and self.trainer.reload_dataloaders_every_epoch):
        self.trainer.reset_train_dataloader(model)
    with suppress(Exception):
        self.trainer.train_dataloader.sampler.set_epoch(epoch)
    self.trainer.accumulation_scheduler.on_train_epoch_start(self.trainer, self.trainer.lightning_module)
    self.accumulated_loss = TensorRunningAccum(window_length=self.trainer.accumulate_grad_batches)
    self.trainer.call_hook('on_epoch_start')
    self.trainer.call_hook('on_train_epoch_start')