code: def convert_to_torch_tensor(word_to_float_list_dict, vocab):
      dim = len(next(iter(word_to_float_list_dict.values())))
      tensor = torch.zeros((len(vocab), dim))
      for word, values in word_to_float_list_dict.items():
          tensor[vocab.tokens_to_ids[word]] = torch.Tensor(values)
      return tensor
  
imports: import math
  import warnings
  import torch
  import torch.nn
  from torch.nn.utils import skip_init
  from onmt.modules.util_class import Elementwise
  from onmt.utils.logging import logger
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