def testInvalidInputShape(self):
     image = tf.constant([[[1], [2]], [[3], [4]]], dtype=tf.float32)
     boxes = tf.constant([[-1, -1, 1, 1]], dtype=tf.float32)
     crop_size = [4, 4]
     with self.assertRaises(ValueError):
         spatial_ops.matmul_crop_and_resize(image, boxes, crop_size)
 def graph_fn(image, boxes):
     return spatial_ops.matmul_crop_and_resize(image,
                                               boxes,
                                               crop_size=[2, 2])