def filter_op_instances(func_attrs, x_shapes):
    """
    Filter out some of the func's op instances using the filter function.
    """
    target = backend.target.Target.current()
    func_key = "{target}.{op}.filter".format(
        target=target.name(),
        op=func_attrs["op"],
    )
    filter_func = registry.get(func_key)

    op_names_to_keep = set()
    for x_shape in x_shapes:
        for op_name in func_attrs["op_instance"]:
            if filter_func(op_name, func_attrs, x_shape):
                op_names_to_keep.add(op_name)

    return {
        op_name: op
        for op_name, op in func_attrs["op_instance"].items()
        if op_name in op_names_to_keep
    }

    Filter out some of the func's op instances using the filter function.
    
python/aitemplate/compiler/ops/conv/conv_common.py