keras/src/backend/tensorflow/trainer.py/TensorFlowTrainer/compiled_metrics
class TensorFlowTrainer:    def compiled_metrics(self):
        class DeprecatedCompiledMetric:
            def update_state(_, y, y_pred, sample_weight=None):
                return self._compiled_metrics_update_state(
                    y, y_pred, sample_weight=sample_weight
                )

        return DeprecatedCompiledMetric()