def METHOD_NAME(tr_tensor):
    factors = tr_tensor
    n_factors = len(factors)
    if n_factors < 2:
        raise ValueError(
            "A Tensor Ring tensor should be composed of at least two factors."
            f"However, {n_factors} factor was given."
        )
    rank = []
    shape = []
    for index, factor in enumerate(factors):
        current_rank, current_shape, next_rank = tl.shape(factor)
        # Check that factors are third order tensors
        if not tl.ndim(factor) == 3:
            raise ValueError(
                "TR expresses a tensor as third order factors (tr-cores).\n"
                f"However, tl.ndim(factors[{index}]) = {tl.ndim(factor)}"
            )
        # Consecutive factors should have matching ranks
        if tl.shape(factors[index - 1])[2] != current_rank:
            raise ValueError(
                "Consecutive factors should have matching ranks\n"
                " -- e.g. tl.shape(factors[0])[2]) == tl.shape(factors[1])[0])\n"
                f"However, tl.shape(factor[{index-1}])[2] == {tl.shape(factors[index-1])[2]} but"
                f" tl.shape(factor[{index}])[0] == {current_rank}"
            )
        shape.append(current_shape)
        rank.append(current_rank)
    # Add last rank (boundary condition)
    rank.append(next_rank)
    return tuple(shape), tuple(rank)