from typing import List


def _split_chunks(n: int, p: int) -> List[int]:
    """
    Private function to calculate chunk sizes for tf.split(). An array/tensor of length n is aimed to be split into p
    number of chunks of roughly equivalent size.

    Parameters
    ----------
    n
        Size of array/tensor to be split.
    p
        Number of chunks.

    Returns
    -------
    List containing the size of each chunk.
    """
    if p >= n:
        chunks = [n]
    else:
        chunks = [n // p + 1] * (n % p) + [n // p] * (p - n % p)
    return chunks