code: def to_undirected(graph):
      """to_undirected"""
      inv_edges = np.zeros(graph.edges.shape)
      inv_edges[:, 0] = graph.edges[:, 1]
      inv_edges[:, 1] = graph.edges[:, 0]
  
      edges = np.vstack((graph.edges, inv_edges))
      edges = np.unique(edges, axis=0)
      #     print(edges.shape)
      g = pgl.graph.Graph(num_nodes=graph.num_nodes, edges=edges)
  
      for k, v in graph._node_feat.items():
          g._node_feat[k] = v
      return g
  
imports: import numpy
  import pgl
  import paddle.fluid
label_desc: Use image node_id 1 for calling a global function with example usage: to_undirected(graph) and returns: g