Skip to content

Commit

Permalink
Merge pull request #66 from sickkids-mri/memleak
Browse files Browse the repository at this point in the history
Fix memory leak caused by alg referencing app object
  • Loading branch information
frankong committed Oct 27, 2020
2 parents ac449e7 + 11dc18f commit 8c25c53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sigpy/mri/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,11 @@ def __init__(self, ksp, calib_width=24,
self.mps = xp.ones(ksp.shape[::-1] + (1, ), dtype=ksp.dtype)

def forward(x):
with self.device:
with sp.get_device(x):
return AHA @ x

def normalize(x):
with self.device:
with sp.get_device(x):
return xp.sum(xp.abs(x)**2,
axis=-2, keepdims=True)**0.5

Expand Down

0 comments on commit 8c25c53

Please sign in to comment.