Skip to content

Commit

Permalink
Merge pull request #5273 from voxel51/bugfix/sim-sort-patch
Browse files Browse the repository at this point in the history
Similarity race condition patch
  • Loading branch information
brimoor authored Dec 18, 2024
2 parents 3d5bd81 + 4fdcc9c commit ec2c2e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fiftyone/utils/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,9 @@ def __exit__(self, *args):
torch.backends.cudnn.benchmark = self._benchmark_orig
self._benchmark_orig = None

self._no_grad.__exit__(*args)
self._no_grad = None
if self._no_grad is not None:
self._no_grad.__exit__(*args)
self._no_grad = None

@property
def media_type(self):
Expand Down

0 comments on commit ec2c2e8

Please sign in to comment.