class_docstr: Implementation of Dataset class
  
  This is a simple implementation of loading and processing dataset for GATNE model.
  
  Args:
      config: dict, some configure parameters.
class_docstr_tok: ["Implementation","of","Dataset","class","This","is","a","simple","implementation","of","loading","and","processing","dataset","for","GATNE","model",".","Args",":","config",":","dict",",","some","configure","parameters","."]
docstr: Build pgl heterogeneous graph. 
          
docstr_tok: ["Build","pgl","heterogeneous","graph","."]
code: def build_graph(self):
      """Build pgl heterogeneous graph."""
      edge_data_by_type, all_edges, all_nodes = self.load_training_data(
          self.train_edges_file,
          slf_loop=self.config["slf_loop"],
          symmetry_edge=self.config["symmetry_edge"],
      )
  
      num_nodes = len(all_nodes)
      node_features = {
          "index": np.array(
              [i for i in range(num_nodes)], dtype=np.int64
          ).reshape(-1, 1)
      }
  
      self.graph = heter_graph.HeterGraph(
          num_nodes=num_nodes,
          edges=edge_data_by_type,
          node_types=None,
          node_feat=node_features,
      )
  
      self.edge_types = sorted(self.graph.edge_types_info())
      logging.info("total %d nodes are loaded" % (self.graph.num_nodes))
  
file_path: PGL/legacy/examples/GATNE/Dataset.py
imports: import sys
  import os
  import tqdm
  import numpy
  import logging
  import random
  from pgl import heter_graph
  import pickle
label_desc: Use image node_id 2 for calling the Dataset obj's underlying member method code with example usage: obj.build_graph() without return types