diff --git a/src/torchmetrics/functional/regression/pearson.py b/src/torchmetrics/functional/regression/pearson.py index db675c0902f..94bdd54fd47 100644 --- a/src/torchmetrics/functional/regression/pearson.py +++ b/src/torchmetrics/functional/regression/pearson.py @@ -59,7 +59,6 @@ def _pearson_corrcoef_update( n_obs = preds.shape[0] if weights is None else weights.sum() cond = n_prior.mean() > 0 or n_obs == 1 - # Calculate means if cond: if weights is None: mx_new = (n_prior * mean_x + preds.sum(0)) / (n_prior + n_obs)