def valid_odd_size(size):
    """
    Validates that a kernel shape is of odd ints and of with 2 dimensions

    :param size: the shape (size) to be checked
    :return: False if size is invalid
    """
    if type(size) not in (list, tuple):
        return False
    if len(size) != 2:
        return False
    if size[0] % 2 != 1 or size[1] % 2 != 1:
        return False
    return True