Skip to content

Commit

Permalink
Update (base update)
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
vmoens committed Dec 16, 2024
1 parent 75c138b commit 4c005e2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sota-implementations/td3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ def make_replay_buffer(
):
if compile:
prefetch = 0
with (
tempfile.TemporaryDirectory()
if scratch_dir in ("", None)
else nullcontext(scratch_dir)
) as scratch_dir:
if scratch_dir in ("", None):
ctx = nullcontext(None)
elif scratch_dir == "temp":
ctx = tempfile.TemporaryDirectory()
else:
ctx = nullcontext(scratch_dir)
with ctx as scratch_dir:
storage_cls = (
functools.partial(LazyTensorStorage, device=device, compilable=compile)
if not scratch_dir
Expand Down

0 comments on commit 4c005e2

Please sign in to comment.