diff --git a/test/test_tensordict.py b/test/test_tensordict.py index fcd1626e1..f84585777 100644 --- a/test/test_tensordict.py +++ b/test/test_tensordict.py @@ -6392,6 +6392,8 @@ def test_to_device_dtype_inplace(self, td_name, device): ) elif td_name in ("permute_td", "unsqueezed_td", "squeezed_td", "td_h5"): cm = pytest.raises(TypeError, match="Cannot use inplace=True with") + elif td_name in ("memmap_td",) and dest.type == "cpu": + cm = contextlib.nullcontext() elif td.is_locked: cm = pytest.raises(RuntimeError, match="Cannot modify locked TensorDict.") else: