def PADDINGS_FILTER()

in Synthesis_incorporation/value_search/operation_filtering.py [0:0]


def PADDINGS_FILTER(arg_value):
    """Must be a [N, 2] shape int32 tensor or nested sequence of ints."""
    if arg_value.is_sequence:
        elem_type = arg_value.elem_type
        shape = arg_value.sequence_shape
    else:
        return False
    if not (
        elem_type in [int, float]
        and len(shape) == 1
        and shape[0] % 2 == 0
        and shape[0] / 2 <= limits.MAX_NUM_DIMENSIONS
    ):
        return False
    return 0 <= arg_value.min() and arg_value.max() < limits.MAX_DIMENSION_LENGTH / 2