diff --git a/deepdow/layers/misc.py b/deepdow/layers/misc.py index 1869363..3b4cd58 100644 --- a/deepdow/layers/misc.py +++ b/deepdow/layers/misc.py @@ -141,7 +141,7 @@ def compute_covariance(m, shrinkage_strategy=None, shrinkage_coef=0.5): """ fact = 1.0 / (m.size(1) - 1) - m -= torch.mean(m, dim=1, keepdim=True) # !!!!!!!!!!! INPLACE + m = m - torch.mean(m, dim=1, keepdim=True) mt = m.t() s = fact * m.matmul(mt) # sample covariance matrix