code: def edge_softmax(graph, logits, norm_by="dst"):
      """Compute softmax over edge weight of incoming edges of every node.
  
      Args:
  
          logits (Tensor): The input edge feature.
  
          norm_by (str): Normalized by source nodes or destination nodes.
                         ("src" or "dst", default is "dst")
  
      Return:
  
          A paddle.Tensor of return softmax value.
  
      """
  
      src, dst, eid = graph.sorted_edges(sort_by=norm_by)
      uniq_ind, segment_ids = graph.get_segment_ids(
          src, dst, segment_by=norm_by
      )
      logits = paddle.gather(logits, eid, axis=0)
      score = pgl.math.segment_softmax(logits, segment_ids)
      init_output = paddle.zeros_like(score, dtype=score.dtype)
      score = paddle.scatter(init_output, eid, score)
      return score
  
file_path: PGL/pgl/nn/functional/graph_op.py
imports: import paddle
  import paddle.nn
  import pgl
  import pgl.math
label_desc: Use image node_id 4 for calling a global function with example usage: edge_softmax(graph, logits, norm_by) and returns: score