I am trying to implement the following function to train a neural network as below:
# Here I am trying to convert train edges to nx.graph data