def len_float_or_list(var):
    """
    Helper function for handling cases where only one epoch was run. 
    
    These abnormal cases result in a float instead of a list, hence len() would create an exception.
    """
    if type(var) == list:
        return len(var)
    elif type(var) == float:
        return 1
    else:
        return len(var)