class_docstr: An abstract class for sampled subgraph. In the context of a
  heterogeneous graph, each field should be of `Dict` type. Otherwise,
  for homogeneous graphs, each field should correspond to its respective
  value type.
class_docstr_tok: ["An","abstract","class","for","sampled","subgraph",".","In","the","context","of","a","heterogeneous","graph",",","each","field","should","be","of","`","Dict","`","type",".","Otherwise",",","for","homogeneous","graphs",",","each","field","should","correspond","to","its","respective","value","type","."]
docstr: Copy `SampledSubgraph` to the specified device using reflection.
docstr_tok: ["Copy","`","SampledSubgraph","`","to","the","specified","device","using","reflection","."]
code: def to(
      self, device: torch.device
  ) -> None:  # pylint: disable=invalid-name
      """Copy `SampledSubgraph` to the specified device using reflection."""
  
      for attr in dir(self):
          # Only copy member variables.
          if not callable(getattr(self, attr)) and not attr.startswith(
              "__"
          ):
              setattr(
                  self,
                  attr,
                  recursive_apply(
                      getattr(self, attr), lambda x: apply_to(x, device)
                  ),
              )
  
      return self
  
file_path: dgl/python/dgl/graphbolt/sampled_subgraph.py
imports: from typing import Dict, Tuple, Union
  import torch
  from dgl.utils import recursive_apply
  from .base import apply_to, CSCFormatBase, etype_str_to_tuple, isin
label_desc: Use image node_id 6 for calling the SampledSubgraph obj's underlying member method code with example usage: obj.to(device) and returns: self