code: def convert_to_torch_tensor(word_to_float_list_dict, vocab):
      dim = len(six.next(six.itervalues(word_to_float_list_dict)))
      tensor = torch.zeros((len(vocab), dim))
      for word, values in word_to_float_list_dict.items():
          tensor[vocab[word]] = torch.Tensor(values)
      return tensor
  
file_path: OpenNMT-py/tools/embeddings_to_torch.py
imports: from __future__ import division
  import six
  import argparse
  import torch
  from onmt.utils.logging import init_logger, logger
  from onmt.inputters.inputter import dict_to_vocabs
label_desc: Use image node_id 3 for calling a global function with example usage: convert_to_torch_tensor(word_to_float_list_dict, vocab) and returns: tensor