Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions test/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10208,11 +10208,11 @@ def test_multistep_transform(self):
t = MultiStepTransform(3, 0.98)

outs_2 = []
td = env.reset()
td = env.reset().contiguous()
for _ in range(1):
rollout = env.rollout(
250, auto_reset=False, tensordict=td, break_when_any_done=False
)
).contiguous()
out = t._inv_call(rollout)
td = rollout[..., -1]
outs_2.append(out)
Expand All @@ -10225,15 +10225,15 @@ def test_multistep_transform(self):
torch.manual_seed(0)

outs = []
td = env.reset()
td = env.reset().contiguous()
for i in range(5):
rollout = env.rollout(
50, auto_reset=False, tensordict=td, break_when_any_done=False
)
).contiguous()
out = t._inv_call(rollout)
# tests that the data is insensitive to the collection schedule
assert_allclose_td(out, outs_2[i])
td = rollout[..., -1]["next"]
td = rollout[..., -1]["next"].exclude("reward")
outs.append(out)

outs = torch.cat(outs, -1)
Expand All @@ -10245,11 +10245,11 @@ def test_multistep_transform(self):
torch.manual_seed(0)

outs_3 = []
td = env.reset()
td = env.reset().contiguous()
for _ in range(125):
rollout = env.rollout(
2, auto_reset=False, tensordict=td, break_when_any_done=False
)
).contiguous()
out = t._inv_call(rollout)
td = rollout[..., -1]["next"]
if out is not None:
Expand Down