class_docstr: Represent a single graph with additional attributes.
class_docstr_tok: ["Represent","a","single","graph","with","additional","attributes","."]
docstr: Convert to dgl.DGLGraph
  Note that there will be some information loss when calling this function,
  e.g. the batch-related information
  will not be copied to DGLGraph since it is only intended for computation.
  
  Returns
  -------
  g : dgl.DGLGraph
      The converted dgl.DGLGraph
code: def to_dgl(self) -> dgl.DGLGraph:
      """
      Convert to dgl.DGLGraph
      Note that there will be some information loss when calling this function,
      e.g. the batch-related information
      will not be copied to DGLGraph since it is only intended for computation.
  
      Returns
      -------
      g : dgl.DGLGraph
          The converted dgl.DGLGraph
      """
      u, v = self._edge_indices.src, self._edge_indices.tgt
      num_nodes = self.get_node_num()
      dgl_g = dgl.graph(data=(u, v), num_nodes=num_nodes).to(
          self.device
      )
      # Add nodes and their features
      for key, value in self._node_features.items():
          if value is not None:
              dgl_g.ndata[key] = value
      # Add edges and their features
      for key, value in self._edge_features.items():
          if value is not None:
              dgl_g.edata[key] = value
      return dgl_g
  
imports: import os
  import warnings
  from collections import namedtuple
  from typing import Any, Callable, Dict, List, Tuple, Union
  import dgl
  import scipy.sparse
  import torch
  from torch.nn.utils.rnn import pad_sequence
  from .utils import EdgeNotFoundException, SizeMismatchException, check_and_expand, entail_zero_padding, int_to_list, slice_to_list
  from .views import BatchEdgeFeatView, BatchNodeFeatView, EdgeView, NodeFeatView, NodeView
label_desc: Use image node_id 24 for calling the GraphData obj's underlying member method code with example usage: obj.to_dgl() and returns: dgl_g