code: def to_dense_batch(x, graph, fill_value=0, max_num_nodes=None):
      """Transfrom a batch of graphs to a dense node feature tensor and
         provide the mask  holing the positions of dummy nodes
  
      Args:
          x (paddle.tensor): The feature map of nodes
  
          graph (pgl.Graph): The graph holing the graph node id
  
          fill_value (bool): The value of dummy nodes. Default: 0.
  
          max_node_nodes: The dimension of nodes in dense batch. Default: None
  
      Returns:
  
          out (paddle.tensor): Returns a dense node feature tensor (shape = [batch_size,max_num_nodes,-1])
          mask (paddle.tensor): Return a mask indicating the position of dummy nodes (shape = [batch_size, max_num_nodes])
  
      """
      graph_node_id = graph.graph_node_id
      batch_size = (graph_node_id.max().item()) + 1
      num_nodes = segment_sum(paddle.ones([x.shape[0]]), graph_node_id)
      cum_nodes = paddle.concat(
          [paddle.zeros([1]), num_nodes.cumsum(0)]
      )
      if max_num_nodes is None:
          max_num_nodes = int(num_nodes.max())
      idx = paddle.arange(graph_node_id.shape[0], dtype=paddle.int64)
      idx = (idx - cum_nodes[graph_node_id]) + (
          graph_node_id * max_num_nodes
      )
      size = [batch_size * max_num_nodes] + list(x.shape)[1:]
      out = paddle.full(size, fill_value)
      out = paddle.scatter(out, idx, x)
      out = out.reshape([batch_size, max_num_nodes] + list(x.shape)[1:])
      mask = paddle.ones([batch_size * max_num_nodes])
      mask = (
          paddle.scatter(mask, idx, paddle.zeros([idx.shape[0]]))
          .reshape([batch_size, max_num_nodes])
          .astype(paddle.bool)
      )
      return out, mask
  
file_path: PGL/pgl/utils/transform.py
imports: import numpy
  import pgl
  import paddle
  from pgl.math import segment_sum
  from pgl.utils.helper import maybe_num_nodes
label_desc: Use image node_id 3 for calling a global function with example usage: to_dense_batch(x, graph, fill_value, max_num_nodes) and returns: out,  mask