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 = EnsureType(data_type=dtype, track_meta=False)(test_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)