code: def build_graph_model(args):
      """build_graph_model"""
      node_feature_info = [("index", [None], np.dtype("int64"))]
  
      place = fluid.CUDAPlace(0) if args.use_cuda else fluid.CPUPlace()
      graph_wrappers = []
      feed_list = []
  
      graph_wrappers.append(
          pgl.graph_wrapper.GraphWrapper(
              "layer_0", node_feat=node_feature_info
          )
      )
      # edge_feat=[("f", [None, 1], "float32")]))
  
      num_embed = args.num_nodes
  
      num_layers = args.num_layers
  
      src_index = fluid.layers.data(
          "src_index",
          shape=[None],
          dtype="int64",
          append_batch_size=False,
      )
  
      dst_index = fluid.layers.data(
          "dst_index",
          shape=[None],
          dtype="int64",
          append_batch_size=False,
      )
  
      feature = fluid.layers.embedding(
          input=fluid.layers.reshape(
              graph_wrappers[0].node_feat["index"], [-1, 1]
          ),
          size=(num_embed + 1, args.hidden_size),
          is_sparse=args.is_sparse,
          is_distributed=args.is_distributed,
      )
  
      features = [feature]
      ret_dict = RetDict()
      ret_dict.graph_wrappers = graph_wrappers
      edge_data = [src_index, dst_index]
      feed_list.extend(edge_data)
      ret_dict.feed_list = feed_list
  
      for i in range(num_layers):
          if i == num_layers - 1:
              act = None
          else:
              act = "leaky_relu"
          feature = get_layer(
              args.layer_type,
              graph_wrappers[0],
              feature,
              args.hidden_size,
              act,
              name="%s_%s" % (args.layer_type, i),
          )
          features.append(feature)
  
      src_feat = fluid.layers.gather(features[-1], src_index)
      src_feat = fluid.layers.fc(
          src_feat,
          args.hidden_size,
          bias_attr=None,
          param_attr=fluid.ParamAttr(name="feat"),
      )
      dst_feat = fluid.layers.gather(features[-1], dst_index)
      dst_feat = fluid.layers.fc(
          dst_feat,
          args.hidden_size,
          bias_attr=None,
          param_attr=fluid.ParamAttr(name="feat"),
      )
      if args.phase == "predict":
          node_id = fluid.layers.data(
              "node_id",
              shape=[None, 1],
              dtype="int64",
              append_batch_size=False,
          )
          ret_dict.src_feat = src_feat
          ret_dict.dst_feat = dst_feat
          ret_dict.id = node_id
          return ret_dict
  
      batch_size = args.batch_size
      batch_negative_label = fluid.layers.reshape(
          fluid.layers.range(0, batch_size, 1, "int64"), [-1, 1]
      )
      batch_negative_label = fluid.layers.one_hot(
          batch_negative_label, batch_size
      )
      batch_loss_weight = (
          batch_negative_label * (batch_size - 2) + 1.0
      ) / (batch_size - 1)
      batch_loss_weight.stop_gradient = True
      batch_negative_label = batch_negative_label
      batch_negative_label = fluid.layers.cast(
          batch_negative_label, dtype="float32"
      )
      batch_negative_label.stop_gradient = True
  
      cos_theta = fluid.layers.matmul(
          src_feat, dst_feat, transpose_y=True
      )
  
      # Calc Loss
      loss = fluid.layers.sigmoid_cross_entropy_with_logits(
          x=cos_theta, label=batch_negative_label
      )
      loss = loss * batch_loss_weight
      # loss = fluid.layers.reduce_sum(loss, -1)
      loss = fluid.layers.mean(loss)
  
      # Calc AUC
      proba = fluid.layers.sigmoid(cos_theta)
      proba = fluid.layers.reshape(proba, [-1, 1])
      proba = fluid.layers.concat([proba * -1 + 1, proba], axis=1)
      gold_label = fluid.layers.reshape(batch_negative_label, [-1, 1])
      gold_label = fluid.layers.cast(gold_label, "int64")
      (
          auc,
          batch_auc_out,
          [batch_stat_pos, batch_stat_neg, stat_pos, stat_neg],
      ) = fluid.layers.auc(
          input=proba,
          label=gold_label,
          curve="ROC",
      )
  
      ret_dict.loss = loss
      ret_dict.auc = batch_auc_out
      return ret_dict
  
imports: import argparse
  import time
  import glob
  import os
  import numpy
  import pgl
  from pgl.utils.logger import log
  from pgl.utils import paddle_helper
  import paddle
  import paddle.fluid
  import tqdm
  import reader
  import model
label_desc: Use image node_id 4 for calling a global function with example usage: build_graph_model(args) and returns: ret_dict, ret_dict