code: def save(self, filename, full=True):
      os.makedirs(os.path.split(filename)[0], exist_ok=True)
      state = {
          "model": self.model.full_state(),
          "epoch": self.epoch,
          "global_step": self.global_step,
      }
      if full and self.optimizer is not None:
          state["optimizer"] = self.optimizer.state_dict()
      if full and self.criterion is not None:
          state["criterion"] = self.criterion.state_dict()
      if full and self.scheduler is not None:
          state["scheduler"] = self.scheduler.state_dict()
      torch.save(state, filename, _use_new_zipfile_serialization=False)
  
imports: from collections import Counter
  from operator import itemgetter
  import os
  import torch
  import torch.nn
  from torch.nn.utils.rnn import pack_sequence, pad_packed_sequence, pack_padded_sequence, PackedSequence
  from stanza.models.common.data import get_long_tensor
  from stanza.models.common.packed_lstm import PackedLSTM
  from stanza.models.common.utils import open_read_text, tensor_unsort, unsort
  from stanza.models.common.dropout import SequenceUnitDropout
  from stanza.models.common.vocab import UNK_ID, CharVocab
label_desc: Use image node_id 2 for calling the CharacterLanguageModelTrainer obj's underlying member method code with example usage: obj.save(filename, full) without return types