class_docstr: Trainer using distinct optimizers for encoder and decoder nn.
  
  Args:
      model (BaseAE): The model to train
  
      train_dataset (BaseDataset): The training dataset of type
          :class:`~pythae.data.dataset.BaseDataset`
  
      training_args (CoupledOptimizerTrainerConfig): The training arguments summarizing the main
          parameters used for training. If None, a basic training instance of
          :class:`CoupledOptimizerTrainerConfig` is used. Default: None.
  
      encoder_optimizer (~torch.optim.Optimizer): An instance of `torch.optim.Optimizer` used for
          training the encoder. If None, a :class:`~torch.optim.Adam` optimizer is used.
          Default: None.
  
      decoder_optimizer (~torch.optim.Optimizer): An instance of `torch.optim.Optimizer` used for
          training the decoder. If None, a :class:`~torch.optim.Adam` optimizer is used.
          Default: None.
docstr: Saves a checkpoint alowing to restart training from here
  
  Args:
      dir_path (str): The folder where the checkpoint should be saved
      epochs_signature (int): The epoch number
docstr_tok: ["Saves","a","checkpoint","alowing","to","restart","training","from","here","Args",":","dir_path","(","str",")",":","The","folder","where","the","checkpoint","should","be","saved","epochs_signature","(","int",")",":","The","epoch","number"]
code: def save_checkpoint(self, model: BaseAE, dir_path, epoch: int):
      """Saves a checkpoint alowing to restart training from here
  
      Args:
          dir_path (str): The folder where the checkpoint should be saved
          epochs_signature (int): The epoch number"""
  
      checkpoint_dir = os.path.join(
          dir_path, f"checkpoint_epoch_{epoch}"
      )
  
      if not os.path.exists(checkpoint_dir):
          os.makedirs(checkpoint_dir)
  
      # save optimizers
      torch.save(
          deepcopy(self.encoder_optimizer.state_dict()),
          os.path.join(checkpoint_dir, "encoder_optimizer.pt"),
      )
      torch.save(
          deepcopy(self.decoder_optimizer.state_dict()),
          os.path.join(checkpoint_dir, "decoder_optimizer.pt"),
      )
  
      # save model
      if self.distributed:
          model.module.save(checkpoint_dir)
  
      else:
          model.save(checkpoint_dir)
  
      # save training config
      self.training_config.save_json(checkpoint_dir, "training_config")
  
imports: import datetime
  import logging
  import os
  from copy import deepcopy
  from typing import List, Optional
  import torch
  import torch.distributed
  import torch.optim
  import torch.optim.lr_scheduler
  from ...data.datasets import BaseDataset
  from ...models import BaseAE
  from ..base_trainer import BaseTrainer
  from ..trainer_utils import set_seed
  from ..training_callbacks import TrainingCallback
  from .coupled_optimizer_trainer_config import CoupledOptimizerTrainerConfig
label_desc: Use image node_id 12 for calling the CoupledOptimizerTrainer obj's underlying member method code with example usage: obj.save_checkpoint(model, dir_path, epoch) without return types