def METHOD_NAME(test_case):
    for device_args, (m1, m2) in test_args:
        tensor1 = m1.randn(2, 3, 4, 5).to(m1.device(*device_args))
        tensor2 = m2.from_dlpack(m1.to_dlpack(tensor1))
        value = tensor1.cpu().numpy()
        del tensor2
        if device_args[0] == "cuda":
            m2.cuda.synchronize()
            # actually release the cuda memory
            m2.cuda.empty_cache()
        test_case.assertTrue(np.array_equal(tensor1.cpu().numpy(), value))
        tensor1 = m1.randn(2, 3, 4, 5).to(m1.device(*device_args))
        tensor2 = m2.from_dlpack(m1.to_dlpack(tensor1))
        value = tensor2.cpu().numpy()
        del tensor1
        if device_args[0] == "cuda":
            m1.cuda.synchronize()
            m1.cuda.empty_cache()
        test_case.assertTrue(np.array_equal(tensor2.cpu().numpy(), value))