def generate_jobs(
        self,
        args: dict | None = None,
        prev_stage_result: PREV_STAGE_RESULT = None,
    ) -> Generator[MetricsCalculationJob, None, None]:
        """Make a generator that yields a single metrics calculation job.

        Args:
            args: ensemble run config.
            prev_stage_result: ensemble predictions from previous step.

        Returns:
            Generator[MetricsCalculationJob, None, None]: MetricsCalculationJob generator
        """
        del args  # args not used here

        model = get_ensemble_model(self.model_args, normalization_stage=NormalizationStage.IMAGE, input_size=(10, 10))

        if model.evaluator is not None:
            yield MetricsCalculationJob(
                accelerator=self.accelerator,
                predictions=prev_stage_result,
                root_dir=self.root_dir,
                evaluator=model.evaluator,
            )
        else:
            msg = "Model passed to tiled ensemble has no evaluator module which is required to calculate metrics."
            raise RuntimeError(msg)
Make a generator that yields a single metrics calculation job.

        Args:
            args: ensemble run config.
            prev_stage_result: ensemble predictions from previous step.

        Returns:
            Generator[MetricsCalculationJob, None, None]: MetricsCalculationJob generator
        
src/anomalib/pipelines/tiled_ensemble/components/metrics_calculation.py