We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7fefac5 + 8e4a3fb commit 70713b7Copy full SHA for 70713b7
1 file changed
test/rb/test_rb_transforms.py
@@ -541,10 +541,15 @@ def test_filters_dynamically_on_sample(self):
541
assert len(rb) == 4
542
assert rb.sample(4).batch_size[0] == 4
543
# The policy moved on: version-2 data became stale since insertion.
544
+ # The random sampler draws with replacement, so the batch size is
545
+ # not deterministic; the invariant is that no stale element passes.
546
current["version"] = 4
547
sample = rb.sample(4)
- assert sample.batch_size[0] < 4
548
assert (sample["policy_version"] == 3).all()
549
+ # Once everything is stale the batch is deterministically empty.
550
+ current["version"] = 10
551
+ sample = rb.sample(4)
552
+ assert sample.batch_size[0] == 0
553
554
def test_nested_version_key(self):
555
rb = ReplayBuffer(
0 commit comments