import tensorflow as tf

  def test_instance_non_maximum_suppression_1d_scores_empty_inputs(self):
    masks = tf.constant(1.0, shape=[0, 2, 2], dtype=tf.float32)
    scores = tf.constant([], dtype=tf.float32)
    classes = tf.constant([], dtype=tf.int32)
    (nms_masks1,
     nms_scores1,
     nms_classes1,
     _) = isu.instance_non_maximum_suppression_1d_scores(
         masks,
         scores,
         classes,
         min_score_thresh=0.65,
         min_iou_thresh=0.5,
         is_class_agnostic=True)
    nms_masks_expected1 = tf.constant(1.0, shape=[0, 2, 2], dtype=tf.float32)
    nms_scores_expected1 = tf.constant([], dtype=tf.float32)
    nms_classes_expected1 = tf.constant([], dtype=tf.int32)
    (nms_masks2,
     nms_scores2,
     nms_classes2,
     _) = isu.instance_non_maximum_suppression_1d_scores(
         masks,
         scores,
         classes,
         min_score_thresh=0.65,
         min_iou_thresh=0.5,
         is_class_agnostic=False)
    nms_masks_expected2 = tf.constant(1.0, shape=[0, 2, 2], dtype=tf.float32)
