import tensorflow as tf

    nms_masks_expected2 = tf.stack([mask0, mask1, mask4, mask2])
    nms_scores_expected2 = tf.constant([1.0, 0.9, 0.85, 0.8], dtype=tf.float32)
    nms_classes_expected2 = tf.constant([1, 2, 2, 3], dtype=tf.int32)
    self.assertAllEqual(nms_masks1.numpy(), nms_masks_expected1.numpy())
    self.assertAllClose(nms_scores1.numpy(), nms_scores_expected1.numpy())
    self.assertAllEqual(nms_classes1.numpy(), nms_classes_expected1.numpy())
    self.assertAllEqual(nms_masks2.numpy(), nms_masks_expected2.numpy())
    self.assertAllClose(nms_scores2.numpy(), nms_scores_expected2.numpy())
    self.assertAllEqual(nms_classes2.numpy(), nms_classes_expected2.numpy())

  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)
