keras/src/metrics/reduction_metrics.py/Sum/update_state
class Sum:    def update_state(self, values, sample_weight=None):
        values, _ = reduce_to_samplewise_values(
            values, sample_weight, reduce_fn=ops.sum, dtype=self.dtype
        )
        self.total.assign_add(ops.sum(values))