class_docstr: Defines a vocabulary object that will be used to numericalize a field.
  
  Attributes:
      freqs: A collections.Counter object holding the frequencies of tokens
          in the data used to build the Vocab.
      stoi: A collections.defaultdict instance mapping token strings to
          numerical identifiers.
      itos: A list of token strings indexed by their numerical identifiers.
class_docstr_tok: ["Defines","a","vocabulary","object","that","will","be","used","to","numericalize","a","field",".","Attributes",":","freqs",":","A","collections.Counter","object","holding","the","frequencies","of","tokens","in","the","data","used","to","build","the","Vocab",".","stoi",":","A","collections.defaultdict","instance","mapping","token","strings","to","numerical","identifiers",".","itos",":","A","list","of","token","strings","indexed","by","their","numerical","identifiers","."]
docstr: Set the vectors for the Vocab instance from a collection of Tensors.
  
  Arguments:
      stoi: A dictionary of string to the index of the associated vector
          in the `vectors` input argument.
      vectors: An indexed iterable (or other structure supporting __getitem__) that
          given an input index, returns a FloatTensor representing the vector
          for the token associated with the index. For example,
          vector[stoi["string"]] should return the vector for "string".
      dim: The dimensionality of the vectors.
      unk_init (callback): by default, initialize out-of-vocabulary word vectors
          to zero vectors; can be any function that takes in a Tensor and
          returns a Tensor of the same size. Default: torch.Tensor.zero_
docstr_tok: ["Set","the","vectors","for","the","Vocab","instance","from","a","collection","of","Tensors",".","Arguments",":","stoi",":","A","dictionary","of","string","to","the","index","of","the","associated","vector","in","the","`","vectors","`","input","argument",".","vectors",":","An","indexed","iterable","(","or","other","structure","supporting","__getitem__",")","that","given","an","input","index",",","returns","a","FloatTensor","representing","the","vector","for","the","token","associated","with","the","index",".","For","example",",","vector","[","stoi","[","``","string","''","]","]","should","return","the","vector","for","``","string","''",".","dim",":","The","dimensionality","of","the","vectors",".","unk_init","(","callback",")",":","by","default",",","initialize","out-of-vocabulary","word","vectors","to","zero","vectors",";","can","be","any","function","that","takes","in","a","Tensor","and","returns","a","Tensor","of","the","same","size",".","Default",":","torch.Tensor.zero_"]
code: def set_vectors(
      self, stoi, vectors, dim, unk_init=torch.Tensor.zero_
  ):
      """
      Set the vectors for the Vocab instance from a collection of Tensors.
  
      Arguments:
          stoi: A dictionary of string to the index of the associated vector
              in the `vectors` input argument.
          vectors: An indexed iterable (or other structure supporting __getitem__) that
              given an input index, returns a FloatTensor representing the vector
              for the token associated with the index. For example,
              vector[stoi["string"]] should return the vector for "string".
          dim: The dimensionality of the vectors.
          unk_init (callback): by default, initialize out-of-vocabulary word vectors
              to zero vectors; can be any function that takes in a Tensor and
              returns a Tensor of the same size. Default: torch.Tensor.zero_
      """
      self.vectors = torch.Tensor(len(self), dim)
      for i, token in enumerate(self.itos):
          wv_index = stoi.get(token, None)
          if wv_index is not None:
              self.vectors[i] = vectors[wv_index]
          else:
              self.vectors[i] = unk_init(self.vectors[i])
  
imports: from __future__ import unicode_literals
  import array
  from collections import defaultdict
  import io
  import logging
  import os
  import zipfile
  import six
  from six.moves.urllib.request import urlretrieve
  import torch
  from tqdm import tqdm
  import tarfile
  from .utils import reporthook
label_desc: Use image node_id 6 for calling the Vocab obj's underlying member method code with example usage: obj.set_vectors(stoi, vectors, dim, unk_init) without return types