def __init__(self, trainer, multiple_trainloader_mode: str):
    self.trainer = trainer
    self.accumulated_loss = None
    self.warning_cache = WarningCache()
    self._teardown_already_run = False
    self.running_loss = TensorRunningAccum(window_length=20)
    self._curr_step_result = None
    self._cur_grad_norm_dict = None
    self._multiple_trainloader_mode = multiple_trainloader_mode
    self._skip_backward = False
    self.trainer._multiple_trainloader_mode = multiple_trainloader_mode
    self._optimizer_freq_cumsum = None
def __init__(self, trainer, multiple_trainloader_mode: str):
    self.trainer = trainer
    self.accumulated_loss = None
    self.warning_cache = WarningCache()
    self._teardown_already_run = False
    self.running_loss = TensorRunningAccum(window_length=20)
    self._curr_step_result = None
    self._cur_grad_norm_dict = None
    self._multiple_trainloader_mode = multiple_trainloader_mode
    self._skip_backward = False
    self.trainer._multiple_trainloader_mode = multiple_trainloader_mode
    self._optimizer_freq_cumsum = None