def bn_relu(
    mod: _Type[_nn.Module],
    fused_mod: _Type[_nn.Module],
) -> _List[_BackendPatternConfig]:
    """
    Returns backend pattern configs for the following sequence of ops:

    input -> batch_norm -> relu -> output
    """
    return [
        # bn module + relu func/module
        *[
            _BackendPatternConfig(get_fusion_pattern((act, mod)))
            .set_dtype_configs(weighted_dtype_configs)
            .set_fuser_method(get_fuser_method(fused_mod))
            .set_fused_module(fused_mod)
            for act in [_nn.ReLU, _F.relu]
        ]
    ] + activation_configs(
        ops=[fused_mod]
    )  # fused bn + relu

    Returns backend pattern configs for the following sequence of ops:

    input -> batch_norm -> relu -> output
    
coremltools/optimize/torch/quantization/_backend_config_utils.py