code: def get_degree(edge, num_nodes):
      init_output = L.fill_constant(
          shape=[num_nodes], value=0, dtype="float32"
      )
      init_output.stop_gradient = True
      final_output = L.scatter(
          init_output,
          edge,
          L.full_like(edge, 1, dtype="float32"),
          overwrite=False,
      )
      return final_output
  
file_path: PGL/ogb_examples/nodeproppred/ogbn-proteins/unimp_cross_feat/module/transformer_gat_pgl.py
imports: import paddle.fluid
  import paddle.fluid.layers
  from pgl import graph_wrapper
  from pgl.utils import paddle_helper
  import math
label_desc: Use image node_id 1 for calling a global function with example usage: get_degree(edge, num_nodes) and returns: final_output