def pattern_add(x):
        """
        Original:
            % 4 = linear(x= % 1, weight = % 2, bias = % 3)  # %2 is a rank-2 const tensor (weight)
            # %3 is a rank-1 const tensor (bias)
            ...
            % 6 = add(x= % 4, y = % 5)  # %5 is a const tensor with same shape as %3

        Result:
            % 8 = linear(x= % 1, weight = % 2, bias = % 7)  # where %7 is a new const tensor with value
            # %7 = %3 + %6
        """
        linear = mb.linear(x=x, weight=arbitrary_weight, bias=arbitrary_bias, name="linear")
        add_or_sub = mb.add(x=linear, y=arbitrary_bias, name="add_or_sub")
        return add_or_sub

        Original:
            % 4 = linear(x= % 1, weight = % 2, bias = % 3)  # %2 is a rank-2 const tensor (weight)
            # %3 is a rank-1 const tensor (bias)
            ...
            % 6 = add(x= % 4, y = % 5)  # %5 is a const tensor with same shape as %3

        Result:
            % 8 = linear(x= % 1, weight = % 2, bias = % 7)  # where %7 is a new const tensor with value
            # %7 = %3 + %6
        
coremltools/converters/mil/experimental/passes/generic_linear_bias_fusion.py