def METHOD_NAME(self):
    # simulate complicated input data
    test_data = {
        "img": np.array([1.0, 2.0], dtype=np.float32),
        "meta": {"dims": 3, "size": np.array([1, 2, 3]), "path": "temp/test"},
        "extra": None,
    }
    for dtype in ("tensor", "numpy"):
        result = EnsureTyped(keys="data", data_type=dtype, device="cpu")({"data": test_data})["data"]
        self.assertTrue(isinstance(result, dict))
        self.assertTrue(isinstance(result["img"], torch.Tensor if dtype == "tensor" else np.ndarray))
        assert_allclose(result["img"], torch.as_tensor([1.0, 2.0]), type_test=False)
        self.assertTrue(isinstance(result["meta"]["size"], torch.Tensor if dtype == "tensor" else np.ndarray))
        assert_allclose(result["meta"]["size"], torch.as_tensor([1, 2, 3]), type_test=False)
        self.assertEqual(result["meta"]["path"], "temp/test")
        self.assertEqual(result["extra"], None)