Skip to content

Commit e5cba04

Browse files
author
Vincent Moens
committed
[Performance] Use TensorDict._new_unsafe in step
ghstack-source-id: 8a117fb Pull Request resolved: #2905
1 parent 382430d commit e5cba04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchrl/envs/gym_like.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def _step(self, tensordict: TensorDictBase) -> TensorDictBase:
343343
for key, val in TensorDict(obs_dict, []).items(True, True)
344344
)
345345
else:
346-
tensordict_out = TensorDict(
346+
tensordict_out = TensorDict._new_unsafe(
347347
obs_dict,
348348
batch_size=tensordict.batch_size,
349349
)

0 commit comments

Comments
 (0)