class_docstr: GINModel
docstr: forward
docstr_tok: ["forward"]
code: def forward(self):
      """forward"""
      features_list = [self.gw.node_feat["attr"]]
  
      for i in range(self.num_layers):
          h = gin(
              self.gw,
              features_list[i],
              hidden_size=self.hidden_size,
              activation="relu",
              name="gin_%s" % (i),
              init_eps=0.0,
              train_eps=self.train_eps,
          )
  
          h = fl.layer_norm(
              h,
              begin_norm_axis=1,
              param_attr=fluid.ParamAttr(
                  name="norm_scale_%s" % (i),
                  initializer=fluid.initializer.Constant(1.0),
              ),
              bias_attr=fluid.ParamAttr(
                  name="norm_bias_%s" % (i),
                  initializer=fluid.initializer.Constant(0.0),
              ),
          )
  
          h = fl.relu(h)
  
          features_list.append(h)
  
      output = 0
      for i, h in enumerate(features_list):
          pooled_h = pgl.layers.graph_pooling(
              self.gw, h, self.pool_type
          )
          drop_h = fl.dropout(
              pooled_h,
              self.dropout_prob,
              dropout_implementation="upscale_in_train",
          )
          output += fl.fc(
              drop_h,
              size=self.num_class,
              act=None,
              param_attr=fluid.ParamAttr(name="final_fc_%s" % (i)),
          )
  
      # calculate loss
      self.loss = fl.softmax_with_cross_entropy(output, self.labels)
      self.loss = fl.reduce_mean(self.loss)
      self.acc = fl.accuracy(fl.softmax(output), self.labels)
  
file_path: PGL/legacy/examples/gin/model.py
imports: import numpy
  import paddle.fluid
  import paddle.fluid.layers
  import pgl
  from pgl.layers.conv import gin
label_desc: Use image node_id 2 for calling the GINModel obj's underlying member method code with example usage: obj.forward() without return types