class_docstr: An embedding module represents a sequence of sentences
  
  Args:
      lstm_config (BiLSTM.Config): config of the lstm layer
      num_embeddings (int): Total number of words/tokens (vocabulary size).
      embedding_dim (int): Size of embedding vector.
      embeddings_weight (torch.Tensor): Pretrained weights to initialize the
          embedding table with.
      init_range (List[int]): Range of uniform distribution to initialize the
          weights with if `embeddings_weight` is None.
      unk_token_idx (int): Index of UNK token in the word vocabulary.
class_docstr_tok: ["An","embedding","module","represents","a","sequence","of","sentences","Args",":","lstm_config","(","BiLSTM.Config",")",":","config","of","the","lstm","layer","num_embeddings","(","int",")",":","Total","number","of","words\/tokens","(","vocabulary","size",")",".","embedding_dim","(","int",")",":","Size","of","embedding","vector",".","embeddings_weight","(","torch.Tensor",")",":","Pretrained","weights","to","initialize","the","embedding","table","with",".","init_range","(","List","[","int","]",")",":","Range","of","uniform","distribution","to","initialize","the","weights","with","if","`","embeddings_weight","`","is","None",".","unk_token_idx","(","int",")",":","Index","of","UNK","token","in","the","word","vocabulary","."]
docstr: Factory method to construct an instance of WordEmbedding from
  the module's config object and the field's metadata object.
  
  Args:
      config (WordSeqEmbedding.Config): Configuration object specifying all the
      parameters of WordEmbedding.
  
  Returns:
      type: An instance of WordSeqEmbedding.
docstr_tok: ["Factory","method","to","construct","an","instance","of","WordEmbedding","from","the","module","'s","config","object","and","the","field","'s","metadata","object",".","Args",":","config","(","WordSeqEmbedding.Config",")",":","Configuration","object","specifying","all","the","parameters","of","WordEmbedding",".","Returns",":","type",":","An","instance","of","WordSeqEmbedding","."]
code: def from_config(
      cls,
      config: Config,
      tensorizer: Tensorizer = None,
      init_from_saved_state: Optional[bool] = False,
  ):
      """Factory method to construct an instance of WordEmbedding from
      the module's config object and the field's metadata object.
  
      Args:
          config (WordSeqEmbedding.Config): Configuration object specifying all the
          parameters of WordEmbedding.
  
      Returns:
          type: An instance of WordSeqEmbedding.
      """
      embeddings_weight = None
      # We don't need to load pretrained embeddings if we know the
      # embedding weights are going to be loaded from a snapshot.
      if (
          config.pretrained_embeddings_path
          and not init_from_saved_state
      ):
          pretrained_embedding = PretrainedEmbedding(
              config.pretrained_embeddings_path,  # doesn't support fbpkg
              lowercase_tokens=config.lowercase_tokens,
              skip_header=config.skip_header,
              delimiter=config.delimiter,
          )
          embeddings_weight = (
              pretrained_embedding.initialize_embeddings_weights(
                  tensorizer.vocab.idx,
                  tensorizer.vocab.unk_token,
                  config.word_embed_dim,
                  config.embedding_init_strategy,
              )
          )
      num_embeddings = len(tensorizer.vocab)
      unk_token_idx = tensorizer.vocab.get_unk_index()
      vocab = tensorizer.vocab
      vocab_pad_idx = vocab.get_pad_index(value=-1)
      if vocab_pad_idx == -1:
          vocab_pad_idx = None
  
      return cls(
          lstm_config=config.lstm,
          num_embeddings=num_embeddings,
          word_embed_dim=config.word_embed_dim,
          embeddings_weight=embeddings_weight,
          init_range=config.embedding_init_range,
          init_std=config.embeddding_init_std,
          unk_token_idx=unk_token_idx,
          padding_idx=config.padding_idx or vocab_pad_idx,
          vocab=vocab,
      )
  
file_path: pytext/pytext/models/embeddings/word_seq_embedding.py
imports: from typing import List, Optional
  import torch
  from pytext.data.tensorizers import Tensorizer
  from pytext.models.embeddings.embedding_base import EmbeddingBase
  from pytext.models.representations.bilstm import BiLSTM
  from pytorch.text.fb.utils.config_utils import EmbedInitStrategy
  from pytorch.text.fb.utils.embeddings import PretrainedEmbedding
  from torch import nn
  from torch.utils.tensorboard import SummaryWriter
label_desc: Use image node_id 1 for calling the WordSeqEmbedding obj's underlying member method code with example usage: obj.from_config(cls, config, tensorizer, init_from_saved_state) and returns: cls