We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5056a62 commit 231555dCopy full SHA for 231555d
torchrl/envs/utils.py
@@ -938,7 +938,7 @@ def make_composite_from_td(
938
# of unbounded values.
939
def make_shape(shape):
940
if shape or not unsqueeze_null_shapes:
941
- if dynamic_shape:
+ if dynamic_shape and shape:
942
return shape[:-1] + (-1,)
943
else:
944
return shape
@@ -954,7 +954,8 @@ def make_shape(shape):
954
if is_tensor_collection(tensor) and not is_non_tensor(tensor)
955
else NonTensor(
956
shape=tensor.shape,
957
- example_data=tensor.data,
+ # Assume all the non-tensors have the same datatype
958
+ example_data=tensor.view(-1)[0].data,
959
device=tensor.device,
960
)
961
if is_non_tensor(tensor)
0 commit comments