class_docstr: Based on Transformer decoder, with support to decoding stacked units
code: def upgrade_state_dict_named(self, state_dict, name):
      if self.n_frames_per_step > 1:
          move_keys = [
              (
                  f"{name}.project_in_dim.weight",
                  f"{name}.embed_tokens.project_in_dim.weight",
              )
          ]
          for from_k, to_k in move_keys:
              if from_k in state_dict and to_k not in state_dict:
                  state_dict[to_k] = state_dict[from_k]
                  del state_dict[from_k]
  
imports: import logging
  from pathlib import Path
  from typing import Any, Dict, List, Optional
  import torch
  from torch import Tensor
  from fairseq import checkpoint_utils, utils
  from fairseq.models import FairseqEncoderDecoderModel, FairseqEncoderModel, FairseqLanguageModel, register_model, register_model_architecture
  from fairseq.models.speech_to_speech.modules.ctc_decoder import CTCDecoder
  from fairseq.models.speech_to_speech.modules.stacked_embedding import StackedEmbedding
  from fairseq.models.speech_to_text import S2TTransformerEncoder
  from fairseq.models.text_to_speech import TTSTransformerDecoder
  from fairseq.models.transformer import Linear, TransformerDecoder, TransformerModelBase
label_desc: Use image node_id 3 for calling the TransformerUnitDecoder obj's underlying member method code with example usage: obj.upgrade_state_dict_named(state_dict, name) without return types