def get_index_dict(nodes):
  """ Get a dict denotes relationships between name and index of nodes.

  Args:
    nodes: A json object contain all the nodes in a mxnet json file.

  Returns:
    A dict with format: {node_name: node_index}
  """
  index_dict = dict()
  for index, node in enumerate(nodes):
    index_dict[node["name"]] = index
  return index_dict