How to use ParallelEnv?

I finished this guide and in the end there’s a note at the end that I can use ParallelEnv env to speed up data collection. I couldn’t find any examples or information about this besides documentation page. So I tried to just change TransformedEnv to ParallelEnv in cod. But when I try to use data collector it throws me errors

The syntax is

ParallelEnv(num_of_p_envs: int, env_constructor: Callable[[], EnvBase], mp_start_method: str="spawn")

if you want to spawn one single env (alternatively you can pass a list of constructors as second argument)
Example

from torchrl.envs import GymEnv, ParallelEnv
import functools
make_env = functools.partial(GymEnv, "CartPole-v1")
num_envs = 2

env = ParallelEnv(num_envs, make_env)
assert env.batch_size = (num_envs, )
print(env.rollout(10, break_when_any_done=False))

The doc is here
https://pytorch.org/rl/reference/generated/torchrl.envs.ParallelEnv.html