def METHOD_NAME():
    """Test for tt_to_tensor
    Uses random tensor as input
    """
    # Create tensor with random elements
    tensor = tl.tensor(np.random.rand(3, 4, 5, 6, 2, 10))
    tensor_shape = tensor.shape
    # Find TT decomposition of the tensor
    rank = 10
    factors = tensor_train(tensor, rank)
    # Reconstruct the original tensor
    reconstructed_tensor = tl.tt_to_tensor(factors)
    assert_(tl.shape(reconstructed_tensor) == tensor_shape)
    # Check that the rank is 10
    D = len(factors)
    for k in range(D):
        (r_prev, _, r_k) = factors[k].shape
        assert r_prev <= rank, "TT rank with index " + str(k) + "exceeds rank"
        assert r_k <= rank, "TT rank with index " + str(k + 1) + "exceeds rank"