docstr: Finally arrived at the end of epoch (full pass on dataset).
  Do some tensorboard logging and checkpoint saving.
docstr_tok: ["Finally","arrived","at","the","end","of","epoch","(","full","pass","on","dataset",")",".","Do","some","tensorboard","logging","and","checkpoint","saving","."]
code: def end_epoch(self):
      """
      Finally arrived at the end of epoch (full pass on dataset).
      Do some tensorboard logging and checkpoint saving.
      """
      logger.info(
          f"{self.n_sequences_epoch} sequences have been trained during this epoch."
      )
  
      if self.is_master:
          self.save_checkpoint(
              checkpoint_name=f"model_epoch_{self.epoch}.pth"
          )
          self.tensorboard.add_scalar(
              tag="epoch/loss",
              scalar_value=self.total_loss_epoch / self.n_iter,
              global_step=self.epoch,
          )
  
      self.epoch += 1
      self.n_sequences_epoch = 0
      self.n_iter = 0
      self.total_loss_epoch = 0
  
imports: import math
  import os
  import time
  import psutil
  import torch
  from torch import nn
  from torch.optim import AdamW
  from torch.utils.data import BatchSampler, DataLoader, RandomSampler
  from torch.utils.data.distributed import DistributedSampler
  from tqdm import tqdm
  from grouped_batch_sampler import GroupedBatchSampler, create_lengths_groups
  from lm_seqs_dataset import LmSeqsDataset
  from transformers import get_linear_schedule_with_warmup
  from utils import logger
label_desc: Use image node_id 10 for calling the Distiller obj's underlying member method code with example usage: obj.end_epoch() without return types