def _cross_suppression(boxes, box_slice, iou_threshold, inner_idx):
  """Bounding-boxes cross-suppression loop body.

  Args:
    boxes: A float Tensor of shape [1, anchors, 4], representing boxes.
    box_slice: A float Tensor of shape [1, _NMS_TILE_SIZE, 4], the box tile
      returned from last iteration
    iou_threshold: A scalar, representing IOU threshold.
    inner_idx: A scalar, representing inner index.

  Returns:
    boxes: A float Tensor of shape [1, anchors, 4], representing boxes.
    ret_slice: A float Tensor of shape [1, _NMS_TILE_SIZE, 4], the box tile
               after suppression
    iou_threshold: A scalar, representing IOU threshold.
    inner_idx: A scalar, inner index incremented.
  """
  new_slice = tf.slice(boxes, [0, inner_idx * _NMS_TILE_SIZE, 0],
                       [1, _NMS_TILE_SIZE, 4])
  iou = batch_iou(new_slice, box_slice)
  ret_slice = tf.expand_dims(
      tf.cast(tf.reduce_all(iou < iou_threshold, [1]), box_slice.dtype),
      2) * box_slice
  return boxes, ret_slice, iou_threshold, inner_idx + 1
Bounding-boxes cross-suppression loop body.

  Args:
    boxes: A float Tensor of shape [1, anchors, 4], representing boxes.
    box_slice: A float Tensor of shape [1, _NMS_TILE_SIZE, 4], the box tile
      returned from last iteration
    iou_threshold: A scalar, representing IOU threshold.
    inner_idx: A scalar, representing inner index.

  Returns:
    boxes: A float Tensor of shape [1, anchors, 4], representing boxes.
    ret_slice: A float Tensor of shape [1, _NMS_TILE_SIZE, 4], the box tile
               after suppression
    iou_threshold: A scalar, representing IOU threshold.
    inner_idx: A scalar, inner index incremented.
  
inference_api/src/main/object_detection/core/post_processing.py