Skip to content

Commit

Permalink
Remove inplace operation
Browse files Browse the repository at this point in the history
  • Loading branch information
jankrepl committed Jan 24, 2024
1 parent 35cd610 commit 092214a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepdow/layers/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 092214a

Please # to comment.