From 092214a8e50b3ead2d05d2f07305ce3522e1f4ef Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 24 Jan 2024 13:16:32 +0100 Subject: [PATCH] Remove inplace operation --- deepdow/layers/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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