def parse_gpu_ids(gpu_str):
    """Parse gpu ids from configuration.
    Args:
        gpu_str: string with gpu indexes
    
    Return:
        a list where each element is the gpu index as int
    """
    gpus = []
    if gpu_str:
        parsed_gpus = gpu_str.split(",")
        if len(gpus) != 1 or int(gpus[0]) >= 0:
            return [int(p) for p in parsed_gpus]
    return gpus