Skip to content

Commit

Permalink
[BugFix] Fix init_random_frames=0
Browse files Browse the repository at this point in the history
ghstack-source-id: 38a544ea15631f9affb4c385c09e7c4df94af55d
Pull Request resolved: #2645
  • Loading branch information
vmoens committed Dec 12, 2024
1 parent b840a77 commit 19dfefc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/test_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ def make_env():
functools.partial(MultiSyncDataCollector, cat_results="stack"),
],
)
@pytest.mark.parametrize("init_random_frames", [50]) # 1226: faster execution
@pytest.mark.parametrize("init_random_frames", [0, 50]) # 1226: faster execution
@pytest.mark.parametrize(
"explicit_spec,split_trajs", [[True, True], [False, False]]
) # 1226: faster execution
Expand Down
4 changes: 2 additions & 2 deletions torchrl/collectors/collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,10 @@ def __init__(
)
self.reset_at_each_iter = reset_at_each_iter
self.init_random_frames = (
int(init_random_frames) if init_random_frames is not None else 0
int(init_random_frames) if init_random_frames not in (None, -1) else 0
)
if (
init_random_frames is not None
init_random_frames not in (-1, None, 0)
and init_random_frames % frames_per_batch != 0
and RL_WARNINGS
):
Expand Down

0 comments on commit 19dfefc

Please sign in to comment.