code: def from_config(
      cls, config: Config, tensorizers: Dict[str, Tensorizer]
  ):
      (
          source_embedding,
          source_vocab,
          dict_embedding,
          dict_vocab,
      ) = create_src_embedding_list(config, tensorizers)
      target_embedding, target_vocab = create_tgt_embedding_list(
          config, tensorizers
      )
      model = create_module(
          config.encoder_decoder,
          source_vocab,
          source_embedding,
          target_vocab,
          target_embedding,
          dict_embedding=dict_embedding,
      )
      output_layer = create_module(config.output_layer, target_vocab)
      length_prediction = cls.construct_length_prediction_module(config)
      return cls(
          model=model,
          length_prediction_model=length_prediction,
          output_layer=output_layer,
          src_vocab=source_vocab,
          trg_vocab=target_vocab,
          dictfeat_vocab=dict_vocab
          if tensorizers.get("dict_feat")
          else None,
          generator_config=config.sequence_generator,
          config=config,
          tensorizer=tensorizers["src_seq_tokens"],
      )
  
imports: from typing import Dict, List, Optional, Tuple, Union
  import torch
  from pytext.common.constants import Stage
  from pytext.data.masked_tensorizer import MaskedTokenTensorizer
  from pytext.data.tensorizers import GazetteerTensorizer, Tensorizer, TokenTensorizer
  from pytext.data.utils import Vocabulary
  from pytext.models.embeddings.scriptable_embedding_list import ScriptableEmbeddingList
  from pytext.models.model import Model
  from pytext.models.module import create_module
  from .conv_model import CNNModel, DecoupledCNNModel
  from .mask_generator import MaskedSequenceGenerator
  from .nar_length import ConvLengthPredictionModule, MaskedLengthPredictionModule
  from .nar_output_layer import NARSeq2SeqOutputLayer
  from .seq2seq_model import Seq2SeqModel
label_desc: Use image node_id 11 for calling the NARSeq2SeqModel obj's underlying member method code with example usage: obj.from_config(cls, config, tensorizers) and returns: cls