Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead

Hi I am trying to work through this tutorial: Reinforcement Learning (PPO) with TorchRL Tutorial — PyTorch Tutorials 2.0.1+cu117 documentation on an M2 MacBook.

I have installed the following:

conda create --name gpu-torch-rl python=3.10 spyder=5.4.3
    conda activate gpu-torch-rl
    git clone /Users/bondgirl007/anaconda3/repos/rl
    cd /Users/bondgirl007/anaconda3/repos/rl/
    pip install -e .
    ImportError: cannot import name 'unravel_key' from 'tensordict' (/Users/myname/anaconda3/envs/gpu-torch-rl/lib/python3.10/site-packages/tensordict/ 
    pip uninstall tensordict
    pip install git+
    Supported version of '_set_gym_args' has not been found.
    pip install gym --upgrade
    DependencyNotInstalled: No module named 'mujoco'. (HINT: you need to install mujoco)
    pip install mujoco

I have an issue running the following line of code:
base_env = GymEnv("InvertedDoublePendulum-v4", device="mps", frame_skip=frame_skip)
I saw there was a suggestion by the library developers in Issues · pytorch/rl · GitHub
Add a DoubleToFloat transform after creating the env on cpu and then map the data with DeviceCastTransform to the MPS device but I don’t understand what syntax to use for that. So I am trying:

base_env = GymEnv("InvertedDoublePendulum-v4", device="cpu", frame_skip=frame_skip)
base_env = DoubleToFloat(base_env)
base_env = DeviceCastTransform(base_env, device="mps", orig_device="cpu")

But I have an error:
TypeError: DeviceCastTransform.__init__() got multiple values for argument 'device'

What is the correct syntax to be able to use mps?

Is there anything someone could recommend please?

You might be looking for
DeviceCastTransform — torchrl main documentation?