def METHOD_NAME(self):
    test_datas = [np.array([[1, 2], [3, 4]]), torch.as_tensor([[1, 2], [3, 4]])]
    if torch.cuda.is_available():
        test_datas.append(test_datas[-1].cuda())
    for test_data in test_datas:
        for dtype in ("tensor", "NUMPY"):
            result = EnsureType(dtype, dtype=np.float32 if dtype == "NUMPY" else None, device="cpu")(test_data)
            if dtype == "NUMPY":
                self.assertTrue(result.dtype == np.float32)
            self.assertTrue(isinstance(result, torch.Tensor if dtype == "tensor" else np.ndarray))
            assert_allclose(result, test_data, type_test=False)
            self.assertTupleEqual(result.shape, (2, 2))