keras/src/metrics/confusion_metrics.py/_ConfusionMatrixConditionCount/result
class _ConfusionMatrixConditionCount:    def result(self):
        if len(self.thresholds) == 1:
            result = self.accumulator[0]
        else:
            result = self.accumulator
        return backend.convert_to_tensor(result)