class_docstr: Represent a single graph with additional attributes.
class_docstr_tok: ["Represent","a","single","graph","with","additional","attributes","."]
docstr: Move the GraphData object to different devices(cpu, gpu, etc.).
  The usage of this method is similar to that of torch.Tensor and
  dgl.DGLGraph
  
  Parameters
  ----------
  device: str
      The target device.
  
  Returns
  -------
  self
code: def to(self, device: str):
      """
      Move the GraphData object to different devices(cpu, gpu, etc.).
      The usage of this method is similar to that of torch.Tensor and
      dgl.DGLGraph
  
      Parameters
      ----------
      device: str
          The target device.
  
      Returns
      -------
      self
      """
      self.device = device
      for k, v in self._node_features.items():
          if isinstance(v, torch.Tensor):
              self._node_features[k] = v.to(device)
      for k, v in self._edge_features.items():
          if isinstance(v, torch.Tensor):
              self._edge_features[k] = v.to(device)
      return self
  
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 2 for calling the GraphData obj's underlying member method code with example usage: obj.to(device) and returns: self