class_docstr: Implementation of SubGraph in pgl.
  
  Subgraph is inherit from :code:`Graph`. The best way to construct subgraph
  is to use :code:`Graph.subgraph` methods to generate Subgraph object.
  
  Args:
      num_nodes: number of nodes in a graph
      edges: list of (u, v) tuples
      node_feat (optional): a dict of numpy array as node features
      edge_feat (optional): a dict of numpy array as edge features (should
                              have consistent order with edges)
      reindex: A dictionary that maps parent graph node id to subgraph node id.
class_docstr_tok: ["Implementation","of","SubGraph","in","pgl",".","Subgraph","is","inherit","from",":","code",":","`","Graph","`",".","The","best","way","to","construct","subgraph","is","to","use",":","code",":","`","Graph.subgraph","`","methods","to","generate","Subgraph","object",".","Args",":","num_nodes",":","number","of","nodes","in","a","graph","edges",":","list","of","(","u",",","v",")","tuples","node_feat","(","optional",")",":","a","dict","of","numpy","array","as","node","features","edge_feat","(","optional",")",":","a","dict","of","numpy","array","as","edge","features","(","should","have","consistent","order","with","edges",")","reindex",":","A","dictionary","that","maps","parent","graph","node","id","to","subgraph","node","id","."]
code: def __init__(
      self,
      num_nodes,
      edges=None,
      node_feat=None,
      edge_feat=None,
      reindex=None,
  ):
      super(SubGraph, self).__init__(
          num_nodes=num_nodes,
          edges=edges,
          node_feat=node_feat,
          edge_feat=edge_feat,
      )
      if reindex is None:
          reindex = {}
      self._from_reindex = reindex
      self._to_reindex = {u: v for v, u in reindex.items()}
  
imports: import os
  import numpy
  import pickle
  import time
  import pgl.graph_kernel
  from collections import defaultdict
label_desc: Use image node_id 1 to create a new SubGraph object from inherited base classes: Graph with example: obj = SubGraph(num_nodes, edges, node_feat, edge_feat, reindex)