def annotate_conv_bn_act_helper(
    model: _torch.fx.GraphModule,
    quantization_config: _Optional[_AnnotationConfig],
    filter_fn: _Optional[_Callable[[_Node], bool]] = None,
    use_bn: bool = False,
) -> _Optional[_List[_List[_Node]]]:
    """
    A helper function for annotating all patterns involving convolution operations, i.e.,

    input -> conv -> batch_norm -> activation -> output

    conv can be either 1D, 2D or 3D
    batch_norm and activation may or may not be applied.
    """
    annotated_partitions = []

    pattern_map = {
        True: get_conv_bn_pattern,
        False: get_conv_pattern,
    }

    conv_dims = [1, 2, 3]
    combinations = _itertools.product(conv_dims, _supported_activations, [True, False])
    for conv_dim, act_fn, act_in_place in combinations:
        pattern_gm = pattern_map[use_bn](conv_dim, act_fn, act_in_place)
        annotated_partitions.extend(
            annotate_weighted_mod_pattern(
                model, pattern_gm, quantization_config, filter_fn
            )
        )

    combinations = _itertools.product(conv_dims, _supported_activations_no_inplace)
    for conv_dim, act_fn in combinations:
        pattern_gm = pattern_map[use_bn](conv_dim, act_fn, act_in_place=False)
        annotated_partitions.extend(
            annotate_weighted_mod_pattern(
                model, pattern_gm, quantization_config, filter_fn
            )
        )

    return annotated_partitions

    A helper function for annotating all patterns involving convolution operations, i.e.,

    input -> conv -> batch_norm -> activation -> output

    conv can be either 1D, 2D or 3D
    batch_norm and activation may or may not be applied.
    
coremltools/optimize/torch/quantization/_coreml_quantizer_utils.py