code: def cdist_paddle(x1, x2, p=2):
      assert x1.shape[1] == x2.shape[1]
      B, M = x1.shape
      # if p == np.inf:
      #     dist = np.max(np.abs(x1[:, np.newaxis, :] - x2[np.newaxis, :, :]), axis=-1)
      if p == 1:
          dist = paddle.sum(
              paddle.abs(x1.unsqueeze(axis=1) - x2.unsqueeze(axis=0)),
              axis=-1,
          )
      else:
          dist = paddle.pow(
              paddle.sum(
                  paddle.pow(
                      paddle.abs(
                          x1.unsqueeze(axis=1) - x2.unsqueeze(axis=0)
                      ),
                      p,
                  ),
                  axis=-1,
              ),
              1 / p,
          )
      return dist
  
imports: import paddle
  import paddle.nn.functional
  from ppdet.modeling.losses.clrnet_line_iou_loss import line_iou
label_desc: Use image node_id 4 for calling a global function with example usage: cdist_paddle(x1, x2, p) and returns: dist