code: def from_config(
      cls,
      config,
      model,
      length_prediction,
      trg_vocab,
      quantize=False,
      embed_quantize=False,
  ):
      return cls(
          config,
          model,
          length_prediction,
          trg_vocab,
          config.beam_size,
          config.use_gold_length,
          config.beam_ranking_algorithm,
          quantize,
          config.embed_quantize,
      )
  
imports: from enum import Enum
  from typing import Dict, Optional, Tuple
  import torch
  from pytext.common.constants import TORCH_VERSION
  from pytext.config import ConfigBase
  from pytext.models.module import Module
  from pytext.torchscript.vocab import ScriptVocabulary
  from torch import Tensor
label_desc: Use image node_id 1 for calling the MaskedSequenceGenerator obj's underlying member method code with example usage: obj.from_config(cls, config, model, length_prediction, trg_vocab, quantize, embed_quantize) and returns: cls