def dtype_str_to_enum(dtype: str) -> int:
    """Returns the AITemplateDtype enum value (defined in model_interface.h) of
    the given dtype str.

    Parameters
    ----------
    dtype: str
        A data type string.

    Returns
    ----------
    int
        the AITemplateDtype enum value.
    """
    if dtype not in _DTYPE_TO_ENUM:
        raise ValueError(
            f"Got unsupported input dtype {dtype}! Supported dtypes are: {list(_DTYPE_TO_ENUM.keys())}"
        )
    return _DTYPE_TO_ENUM[dtype]
Returns the AITemplateDtype enum value (defined in model_interface.h) of
the given dtype str.

Parameters
----------
dtype: str
A data type string.

Returns
----------
int
the AITemplateDtype enum value.
python/aitemplate/compiler/dtype.py