def vars_to_dic(vars):
  """ Converts list of tf variables to a dictionary
      where the var names are the keys

  Args:
      vars: list of variables

  Returns:
      dic
  """
  return dict((var.name.split(":")[0], i)
              for i, var in enumerate(vars))