class_docstr: Implementation of global pooling architecture with SAGPool.
      
code: def __init__(self, args, dataset):
      self.args = args
      self.dataset = dataset
      self.hidden_size = args.hidden_size
      self.num_classes = args.num_classes
      self.num_features = args.num_features
      self.pooling_ratio = args.pooling_ratio
      self.dropout_ratio = args.dropout_ratio
      self.batch_size = args.batch_size
  
      graph_data = []
      g, label = self.dataset[0]
      graph_data.append(g)
      g, label = self.dataset[1]
      graph_data.append(g)
  
      batch_graph = MultiGraph(graph_data)
      indegree = batch_graph.indegree()
      norm = np.zeros_like(indegree, dtype="float32")
      norm[indegree > 0] = np.power(indegree[indegree > 0], -0.5)
      batch_graph.node_feat["norm"] = np.expand_dims(norm, -1)
      graph_data = batch_graph
  
      self.graph_wrapper = GraphWrapper(
          name="graph", node_feat=graph_data.node_feat_info()
      )
      self.labels = L.data(
          "labels",
          shape=[None, self.args.num_classes],
          dtype="int32",
          append_batch_size=False,
      )
  
      self.labels_1dim = L.data(
          "labels_1dim",
          shape=[None],
          dtype="int32",
          append_batch_size=False,
      )
  
      self.graph_id = L.data(
          "graph_id",
          shape=[None],
          dtype="int32",
          append_batch_size=False,
      )
  
      if self.args.dataset_name == "FRANKENSTEIN":
          self.gcn = gcn
      else:
          self.gcn = norm_gcn
  
      self.build_model()
  
file_path: PGL/legacy/examples/SAGPool/model.py
imports: from random import random
  import numpy
  import paddle
  import paddle.fluid
  import paddle.fluid.layers
  import pgl
  from pgl.graph import Graph, MultiGraph
  from pgl.graph_wrapper import GraphWrapper
  from pgl.utils.logger import log
  from pgl.layers.conv import gcn
  from layers import sag_pool
  from conv import norm_gcn
label_desc: Use image node_id 1 to create a new GlobalModel object from inherited base classes: object with example: obj = GlobalModel(args, dataset)