class_docstr: A constraint on the distance between two sentences' thought vectors.
  
  Args:
      word_embedding (textattack.shared.AbstractWordEmbedding): The word embedding to use
class_docstr_tok: ["A","constraint","on","the","distance","between","two","sentences","'","thought","vectors",".","Args",":","word_embedding","(","textattack.shared.AbstractWordEmbedding",")",":","The","word","embedding","to","use"]
docstr: Sums the embeddings of all the words in ``text`` into a "thought
  vector".
docstr_tok: ["Sums","the","embeddings","of","all","the","words","in","``","text","``","into","a","``","thought","vector","''","."]
code: def _get_thought_vector(self, text):
      """Sums the embeddings of all the words in ``text`` into a "thought
      vector"."""
      embeddings = []
      for word in utils.words_from_text(text):
          embedding = self.word_embedding[word]
          if (
              embedding is not None
          ):  # out-of-vocab words do not have embeddings
              embeddings.append(embedding)
      embeddings = torch.tensor(embeddings)
      return torch.mean(embeddings, dim=0)
  
file_path: TextAttack/textattack/constraints/semantics/sentence_encoders/thought_vector.py
imports: import functools
  import torch
  from textattack.shared import AbstractWordEmbedding, WordEmbedding, utils
  from .sentence_encoder import SentenceEncoder
label_desc: Use image node_id 3 for calling the ThoughtVector obj's underlying member method code with example usage: obj._get_thought_vector(text) and returns: torch