Skip to content

Commit

Permalink
amend
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Jun 18, 2024
1 parent fc1ec76 commit 0a8000b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchrl/envs/libs/jax_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _tensordict_to_object(tensordict: TensorDictBase, object_example):
# We need to flatten to fix https://github.com/pytorch/rl/issues/2184
value = value.contiguous()
value = value.detach()
if value.ndim:
if value.ndim > 1:
value = value.flatten().clone()
else:
value = value.clone()
Expand Down

0 comments on commit 0a8000b

Please sign in to comment.