Small bug in torchrl

I noticed a small bug in torchrl.envs.utils:
Indeed in the _per_level_env_check function, line 394 it is coded

if _data0.shape != _data1.shape:
                raise AssertionError(
                    f"The shapes of the real and fake tensordict don't match for key {key}. "
                    f"Got fake={_data0.shape} and real={_data0.shape}."
                )

of course it should be:

if _data0.shape != _data1.shape:
                raise AssertionError(
                    f"The shapes of the real and fake tensordict don't match for key {key}. "
                    f"Got fake={_data0.shape} and real={_data1.shape}."
                )

This obviously has no impact on operation but can be confusing for those who encounter the error message… (of which I am one :exploding_head:)

Thanks for reporting! Would you be interested in submitting a fix to torchrl?

How do you do this? (That said, changing a 0 to 1 is not really complicated…)

You can check the Contribution Guide and create the fix in pytorch/rl. The code owners will then take a look at the fix and merge it.