if batch_size is None:
batch_size = tf.shape(boxes)[0]
if num_anchors is None:
num_anchors = tf.shape(boxes)[1]
// If num valid boxes aren"t provided, create one and mark all boxes as
// valid.
if num_valid_boxes is None:
num_valid_boxes = tf.ones([batch_size], dtype=tf.int32) * num_anchors
// If masks aren"t provided, create dummy masks so we can only have one copy
// of single_image_nms_fn and discard the dummy masks after map_fn.
if masks is None: