def set_dtype(value, dtype):
    """Converts the value to the given dtype."""
    if dtype == 'float':
        value = float(value)
    elif dtype == 'int':
        value = int(value)
    elif dtype == 'str':
        value = value
    return value
