code: def extract_edge_bbox(g):
      """bbox encoding"""
      src, dst = g.edges(order="eid")
      n = g.number_of_edges()
      src_bbox = g.ndata["pred_bbox"][src.asnumpy()]
      dst_bbox = g.ndata["pred_bbox"][dst.asnumpy()]
      edge_bbox = nd.zeros((n, 4), ctx=g.ndata["pred_bbox"].context)
      edge_bbox[:, 0] = nd.stack(src_bbox[:, 0], dst_bbox[:, 0]).min(
          axis=0
      )
      edge_bbox[:, 1] = nd.stack(src_bbox[:, 1], dst_bbox[:, 1]).min(
          axis=0
      )
      edge_bbox[:, 2] = nd.stack(src_bbox[:, 2], dst_bbox[:, 2]).max(
          axis=0
      )
      edge_bbox[:, 3] = nd.stack(src_bbox[:, 3], dst_bbox[:, 3]).max(
          axis=0
      )
      return edge_bbox
  
file_path: dgl/examples/mxnet/scenegraph/utils/build_graph.py
imports: import dgl
  import numpy
  from mxnet import nd
label_desc: Use image node_id 2 for calling a global function with example usage: extract_edge_bbox(g) and returns: edge_bbox