import tensorflow as tf

                          [1, 0, 1, 0, 1]], dtype=tf.int32)
    iou = isu.points_mask_iou(masks1=masks1, masks2=masks2)
    expected_iou = tf.constant([[0, 0, 0],
                                [0, 1, 0.6],
                                [0, 0.6, 1.0],
                                [0, 0.4, 0]], dtype=tf.float32)
    self.assertAllClose(iou.numpy(), expected_iou.numpy())

  def test_points_mask_pairwise_iou(self):
    masks1 = tf.constant([[0, 0, 0, 0, 0],
                          [1, 1, 1, 1, 1],
                          [1, 0, 1, 0, 1],
                          [0, 1, 0, 1, 0]], dtype=tf.int32)
    masks2 = tf.constant([[0, 0, 0, 0, 0],
                          [1, 1, 1, 1, 1],
                          [1, 1, 1, 1, 0],
                          [1, 0, 1, 1, 1]], dtype=tf.int32)
    pairwise_iou = isu.points_mask_pairwise_iou(masks1=masks1, masks2=masks2)
