Skip to content

Commit 448c18a

Browse files
authored
Fix truthiness bug
in age_evict (meta-pytorch#558)
1 parent e2dd4d1 commit 448c18a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/forge/actors/replay_buffer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def age_evict(
3333
"""Buffer eviction policy, remove old or over-sampled entries"""
3434
indices = []
3535
for i, entry in enumerate(buffer):
36-
if max_age and policy_version - entry.data.policy_version > max_age:
36+
if max_age is not None and policy_version - entry.data.policy_version > max_age:
3737
continue
38-
if max_samples and entry.sample_count >= max_samples:
38+
if max_samples is not None and entry.sample_count >= max_samples:
3939
continue
4040
indices.append(i)
4141
return indices

0 commit comments

Comments
 (0)