def get_aligned_size(shape: List[IntVar], dtype: str, alignment: int = 64) -> int:
    """Returns aligned size (in bytes) of given shape and dtype.

    Parameters
    ----------
    shape: List[IntVar]
        A list of IntVars, which represents the shape of a Tensor.
    dtype: str
        A data type string.
    alignment: int
        Alignment requirement (in bytes). Default alignment is 64 bytes.

    Returns
    ----------
    int
        Size (in bytes) of this shape with dtype, aligned in alignment bytes.
    """

    size = reduce(lambda cur, dim: cur * dim.upper_bound(), shape, 1)
    size = size * get_dtype_size(dtype)
    if size % alignment != 0:
        size = int((size // alignment + 1) * alignment)
    return size
Returns aligned size (in bytes) of given shape and dtype.

Parameters
----------
shape: List[IntVar]
A list of IntVars, which represents the shape of a Tensor.
dtype: str
A data type string.
alignment: int
Alignment requirement (in bytes). Default alignment is 64 bytes.

Returns
----------
int
Size (in bytes) of this shape with dtype, aligned in alignment bytes.
python/aitemplate/compiler/base.py