class_docstr: A GPU Graph Object (Base class of other graph types)
  
  Parameters
  ----------
  m_graph : cuGraph.MultiGraph object or None (default=None)
      Initialize the graph from a cugraph.MultiGraph object
  directed : boolean, optional (default=False)
      Indicated is the graph is directed.
  
  Examples
  --------
  >>> # undirected graph
  >>> G = cugraph.Graph()
  >>> # directed graph
  >>> G = cugraph.Graph(directed=True)
class_docstr_tok: ["A","GPU","Graph","Object","(","Base","class","of","other","graph","types",")","Parameters","--","--","--","--","--","m_graph",":","cuGraph.MultiGraph","object","or","None","(","default=None",")","Initialize","the","graph","from","a","cugraph.MultiGraph","object","directed",":","boolean",",","optional","(","default=False",")","Indicated","is","the","graph","is","directed",".","Examples","--","--","--","--",">",">",">","#","undirected","graph",">",">",">","G","=","cugraph.Graph","(",")",">",">",">","#","directed","graph",">",">",">","G","=","cugraph.Graph","(","directed=True",")"]
docstr: Return an undirected copy of the graph.
  
  Returns
  -------
  G : Graph
      A undirected graph with the same nodes, and each directed edge
      (u,v,weights) replaced by an undirected edge (u,v,weights).
  
  Examples
  --------
  >>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ',
  ...                   dtype=['int32', 'int32', 'float32'], header=None)
  >>> DiG = cugraph.Graph(directed=True)
  >>> DiG.from_cudf_edgelist(M, '0', '1')
  >>> G = DiG.to_undirected()
docstr_tok: ["Return","an","undirected","copy","of","the","graph",".","Returns","--","--","--","-","G",":","Graph","A","undirected","graph","with","the","same","nodes",",","and","each","directed","edge","(","u",",","v",",","weights",")","replaced","by","an","undirected","edge","(","u",",","v",",","weights",")",".","Examples","--","--","--","--",">",">",">","M","=","cudf.read_csv","(","datasets_path","\/","'karate.csv","'",",","delimiter=","'","'",",","...","dtype=","[","'int32","'",",","'int32","'",",","'float32","'","]",",","header=None",")",">",">",">","DiG","=","cugraph.Graph","(","directed=True",")",">",">",">","DiG.from_cudf_edgelist","(","M",",","'","0","'",",","'","1","'",")",">",">",">","G","=","DiG.to_undirected","(",")"]
code: def to_undirected(self):
      """
      Return an undirected copy of the graph.
  
      Returns
      -------
      G : Graph
          A undirected graph with the same nodes, and each directed edge
          (u,v,weights) replaced by an undirected edge (u,v,weights).
  
      Examples
      --------
      >>> M = cudf.read_csv(datasets_path / 'karate.csv', delimiter=' ',
      ...                   dtype=['int32', 'int32', 'float32'], header=None)
      >>> DiG = cugraph.Graph(directed=True)
      >>> DiG.from_cudf_edgelist(M, '0', '1')
      >>> G = DiG.to_undirected()
  
      """
  
      if self.graph_properties.directed is False:
          undirected_graph = type(self)()
      elif self.__class__.__bases__[0] == object:
          undirected_graph = type(self)()
      else:
          undirected_graph = self.__class__.__bases__[0]()
      undirected_graph._Impl = type(self._Impl)(
          undirected_graph.graph_properties
      )
      self._Impl.to_undirected(undirected_graph._Impl)
      return undirected_graph
  
imports: import numpy
  from .graph_implementation import simpleGraphImpl, simpleDistributedGraphImpl, npartiteGraphImpl
  import cudf
  import dask_cudf
  from cugraph.utilities.utils import import_optional
label_desc: Use image node_id 25 for calling the Graph obj's underlying member method code with example usage: obj.to_undirected() and returns: undirected_graph