code: def _non_maximum_suppression_gpu(
      bbox, thresh, score=None, limit=None
  ):
      if len(bbox) == 0:
          return cp.zeros((0,), dtype=np.int32)
  
      n_bbox = bbox.shape[0]
  
      if score is not None:
          order = score.argsort()[::-1].astype(np.int32)
      else:
          order = cp.arange(n_bbox, dtype=np.int32)
  
      sorted_bbox = bbox[order, :]
      selec, n_selec = _call_nms_kernel(sorted_bbox, thresh)
      selec = selec[:n_selec]
      selec = order[selec]
      if limit is not None:
          selec = selec[:limit]
      return selec
  
file_path: chainercv/chainercv/utils/bbox/non_maximum_suppression.py
imports: from __future__ import division
  import numpy
  from chainer.backends import cuda
  from chainercv.utils.bbox._nms_gpu_post import _nms_gpu_post
label_desc: Use image node_id 3 for calling a global function with example usage: _non_maximum_suppression_gpu(bbox, thresh, score, limit) and returns: selec, cp