def _get_best_candidate(self) -> Optional[ModelOutput]:
        """Get the best candidate across all devices based on metrics.

        Returns:
            The best ModelOutput across all devices or None if no outputs available

        """
        if not self._device_outputs:
            return None

        model_outputs = [
            acc_output.get_best_candidate()
            for acc_output in self._device_outputs.values()
            if acc_output and acc_output.get_best_candidate()
        ]

        if not model_outputs:
            return None

        sorted_outputs = self._sort_by_metrics(model_outputs, self._objective_dict)
        return sorted_outputs[0] if sorted_outputs else None
Get the best candidate across all devices based on metrics.

        Returns:
            The best ModelOutput across all devices or None if no outputs available

        
olive/engine/output.py