code: def _box_tiles_to_mosaic(
      boxes: tf.Tensor, mosaic_size: int, padding_mask: tf.Tensor
  ) -> tf.Tensor:
      """Reshapes a batch of per-tile boxes into boxes for a mosaic."""
      assert (
          len(boxes.shape) == 3
      ), "Expect shape [num_tiles, n, 4], got {image.shape}."
  
      num_tiles = boxes.shape[0]
      assert num_tiles == mosaic_size**2, (
          "The first dimension must contain exactly self.mosaic_size ** 2 "
          f"elements, but got boxes of shape {boxes.shape}"
      )
  
      # Get offsets by which boxes must be shifted at each tile:
      x_offset, y_offset = tf.meshgrid(
          range(mosaic_size), range(mosaic_size), indexing="xy"
      )
      x_offset = tf.cast(
          tf.reshape(x_offset, [num_tiles, 1, 1]), tf.float32
      )
      y_offset = tf.cast(
          tf.reshape(y_offset, [num_tiles, 1, 1]), tf.float32
      )
  
      # Shift boxes by the tile offsets:
      y0, x0, y1, x1 = tf.split(boxes, 4, axis=-1)
      boxes = tf.concat(
          [y0 + y_offset, x0 + x_offset, y1 + y_offset, x1 + x_offset],
          axis=-1,
      )
  
      # Reshape from [num_tiles, n, 4] to [num_tiles * n, 4]:
      boxes = tf.reshape(boxes, [-1, 4])
      padding_mask = tf.reshape(padding_mask, [-1])
  
      # Remove padding instances:
      boxes = boxes[padding_mask]
  
      # Renormalize boxes:
      return boxes / mosaic_size
  
file_path: scenic/scenic/projects/owl_vit/preprocessing/mosaic.py
imports: import dataclasses
  from typing import Tuple
  from scenic.projects.owl_vit.preprocessing import image_ops
  from scenic.projects.owl_vit.preprocessing import modalities
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: _box_tiles_to_mosaic(boxes, mosaic_size, padding_mask) and returns: unknown