def METHOD_NAME(value):
    if hasattr(value, "dtype"):
        dtype = str(value.dtype)
    elif isinstance(value, bool):
        dtype = "bool"
    elif isinstance(value, float):
        # We intentionally prefer convert the float to float32 since it's more common in DL.
        if -3.40282347e38 <= value <= 3.40282347e38:
            dtype = "float32"
        else:
            dtype = "float64"
    elif isinstance(value, int):
        # We intentionally prefer convert the python int to int32 since it's more common in DL.
        if -2147483648 <= value <= 2147483647:
            dtype = "int32"
        else:
            dtype = "int64"
    else:
        raise NotImplementedError(f"Cannot automatically inference the type. value={value}")
    return dtype