def get_tile_predictions(get_datamodule: AnomalibDataModule) -> EnsemblePredictions:
    """Return tile predictions inside EnsemblePredictions object."""
    datamodule = get_datamodule

    data = EnsemblePredictions()

    for tile_index in [(0, 0), (0, 1), (1, 0), (1, 1)]:
        datamodule.external_collate_fn.tile_index = tile_index

        tile_prediction = []
        batch = next(iter(datamodule.test_dataloader()))

        # make mock labels and scores
        batch.pred_score = torch.rand(batch.gt_label.shape)
        batch.pred_label = batch.pred_score > 0.5

        # set mock maps to just one channel of image
        batch.anomaly_map = batch.image.clone()[:, 0, :, :].unsqueeze(1)
        # set mock pred mask to mask but add channel
        batch.pred_mask = batch.gt_mask.clone().unsqueeze(1)

        tile_prediction.append(batch)

        # store to prediction storage object
        data.add_tile_prediction(tile_index, tile_prediction)

    return data
Return tile predictions inside EnsemblePredictions object.
tests/unit/pipelines/tiled_ensemble/conftest.py