Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix vecnorm state-dicts #2158

Merged
merged 3 commits into from
May 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
amend
  • Loading branch information
vmoens committed May 10, 2024
commit e1f3f30ea71ba2452c69fe3ed3eb8e541162b80e
8 changes: 6 additions & 2 deletions test/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7777,7 +7777,9 @@ def test_vecnorm_parallel_auto(self, nprc):
for idx in range(nprc):
queues[idx][1].put(msg)

td = make_env.state_dict()["transforms.1._extra_state"]["td"]
td = TensorDict(
make_env.state_dict()["transforms.1._extra_state"]
).unflatten_keys(VecNorm.SEP)

obs_sum = td.get(("some", "obs_sum")).clone()
obs_ssq = td.get(("some", "obs_ssq")).clone()
Expand Down Expand Up @@ -7878,7 +7880,9 @@ def test_parallelenv_vecnorm(self):
parallel_sd = parallel_env.state_dict()
assert "worker0" in parallel_sd
worker_sd = parallel_sd["worker0"]
td = worker_sd["transforms.1._extra_state"]["td"]
td = TensorDict(worker_sd["transforms.1._extra_state"]).unflatten_keys(
VecNorm.SEP
)
queue_out.put("start")
msg = queue_in.get(timeout=TIMEOUT)
assert msg == "first round"
Expand Down
Loading