def get_binary_op_act_pattern(
    binary_op: _Callable,
    act_fn: _Optional[_Callable] = None,
    act_in_place: bool = False,
) -> _torch.nn.Module:
    """
    Returns an aten graph corresponding to a sequence of these ops:
    input_1 ---
               \
                --> binary_op -> activation -> output
               /
    input_2 ---

    A binary op is any operation which consumes two inputs to create one output,
    such as addition or multiplication.

    No activation is used if ``act_fn`` is ``None``.
    ``act_fn`` is an activation function from _supported_activations or
    _supported_activations_no_inplace
    """

    class Pattern(_torch.nn.Module):
        def forward(self, input_1, input_2):
            binary_op_out = binary_op(input_1, input_2)
            node_dict = {
                "binary_op": binary_op_out,
            }
            output = binary_op_out
            if act_fn is not None:
                output = act_fn(output, inplace=True) if act_in_place else act_fn(output)
                node_dict["output"] = output
            return output, node_dict

    example_inputs = (_torch.randn(1), _torch.randn(1))
    return _get_aten_graph_module(Pattern(), example_inputs)

    Returns an aten graph corresponding to a sequence of these ops:
    input_1 ---
                               --> binary_op -> activation -> output
               /
    input_2 ---

    A binary op is any operation which consumes two inputs to create one output,
    such as addition or multiplication.

    No activation is used if ``act_fn`` is ``None``.
    ``act_fn`` is an activation function from _supported_activations or
    _supported_activations_no_inplace
    
coremltools/optimize/torch/quantization/_coreml_quantizer_utils.py