def METHOD_NAME(n_pad):
    """Test for pad_tt_rank"""
    # Testing for a tensor-train
    rank = (1, 2, 2, 2, 1)
    tt = random_tt((4, 3, 5, 2), rank=rank)
    padded_tt = tl.tt_tensor.TTTensor(
        pad_tt_rank(tt, n_padding=n_pad, pad_boundaries=False)
    )
    rec = tt.to_tensor()
    rec_padded = padded_tt.to_tensor()
    assert_array_almost_equal(rec, rec_padded, decimal=4)
    assert_(padded_tt.rank == (1, *[i + n_pad for i in rank[1:-1]], 1))
    # Testing for a Tensor-Ring
    rank = (2, 3, 4, 5, 2)
    tr = random_tr((4, 3, 5, 2), rank=rank)
    padded_tr = tl.tr_tensor.TRTensor(
        pad_tt_rank(tr, n_padding=n_pad, pad_boundaries=True)
    )
    rec = tr.to_tensor()
    rec_padded = padded_tr.to_tensor()
    assert_array_almost_equal(rec, rec_padded, decimal=4)
    assert_(padded_tr.rank == tuple([i + n_pad for i in rank]))
    # Testing for a TT-Matrix
    rank = (1, 2, 3, 1)
    ttm = random_tt_matrix((2, 3, 3, 4, 2, 2), rank=rank)
    padded_ttm = tl.tt_matrix.TTMatrix(
        pad_tt_rank(ttm, n_padding=n_pad, pad_boundaries=False)
    )
    rec = ttm.to_tensor()
    rec_padded = padded_ttm.to_tensor()
    assert_array_almost_equal(rec, rec_padded, decimal=4)
    assert_(padded_ttm.rank == (1, *[i + n_pad for i in rank[1:-1]], 1))