def __call__(self, batch: list) -> dict[str, Any]:
        """Collate batch and tile images + masks from batch.

        Args:
            batch (list): Batch of elements from data, also including images.

        Returns:
            dict[str, Any]: Collated batch dictionary with tiled images.
        """
        # use default collate
        coll_batch = self.default_collate_fn(batch)

        tiled_images = self.tiler.tile(coll_batch.image)
        # return only tiles at given index
        coll_batch.image = tiled_images[self.tile_index]

        if hasattr(coll_batch, "gt_mask"):
            # insert channel (as mask has just one)
            tiled_masks = self.tiler.tile(coll_batch.gt_mask.unsqueeze(1))

            # return only tiled at given index, squeeze to remove previously added channel
            coll_batch.gt_mask = tiled_masks[self.tile_index].squeeze(1)

        return coll_batch
Collate batch and tile images + masks from batch.

        Args:
            batch (list): Batch of elements from data, also including images.

        Returns:
            dict[str, Any]: Collated batch dictionary with tiled images.
        
src/anomalib/pipelines/tiled_ensemble/components/utils/ensemble_tiling.py