code: def process_batch_data(
      batch_data, feature=None, norm=None, only_nid=False
  ):
      """Process batch data, mainly for turning numpy.array as paddle.Tensor.
  
      Args:
  
          batch_data (SubgraphData): Batch data returned from dataloader.
  
          feature (numpy.ndarray|paddle.Tensor): The permuted node feature.
  
          norm (numpy.ndarray): Mainly used for GCN norm.
  
          only_nid (bool): If only_nid is True, just return batch_data.n_id.
  
      Returns:
  
          g (pgl.Graph): Return pgl.graph of batch_data, be in Tensor format.
  
          batch_size (int): Return batch size of the input batch_data.
  
          n_id (paddle.Tensor): Return node ids of the input batch_data.
  
          offset (paddle.Tensor): The begin indexes of graph partition parts in batch_data, should be on CPUPlace.
  
          count (paddle.Tensor): The length of graph partition parts in batch_data, should be on CPUPlace.
  
          feat (paddle.Tensor): The new indexed feat gathered by n_id.
  
      """
      if only_nid:
          return batch_data.n_id
  
      g = batch_data.subgraph
      batch_size = batch_data.batch_size
      n_id = batch_data.n_id
      offset = batch_data.offset
      count = batch_data.count
  
      g.tensor()
      offset = paddle.to_tensor(offset, place=paddle.CPUPlace())
      count = paddle.to_tensor(count, place=paddle.CPUPlace())
  
      if feature is not None:
          feat = feature[n_id]
          feat = paddle.to_tensor(feat)
      else:
          feat = None
  
      if norm is not None:
          norm = norm[n_id]
          norm = paddle.to_tensor(norm)
  
      n_id = paddle.to_tensor(n_id)
  
      return g, batch_size, n_id, offset, count, feat, norm
  
file_path: PGL/apps/GNNAutoScale/utils.py
imports: import time
  import functools
  import numpy
  import paddle
  import pgl
  from pgl.utils.logger import log
label_desc: Use image node_id 4 for calling a global function with example usage: process_batch_data(batch_data, feature, norm, only_nid) and returns: g,  batch_size,  n_id,  offset,  count,  feat,  norm, batch_data