def get_fuser_method(constructor):
    """
    Creates fuser method from class constructor of fused modules.
    """
    if _is_torch_2():

        def fuser_method(is_qat, m1, m2):
            if isinstance(m1, tuple):
                m0, m1 = m1
                return constructor(m1, m0, m2)
            return constructor(m1, m2)

    else:

        def fuser_method(is_qat, m1, m2):
            if isinstance(m2, tuple):
                m2, m3 = m2
                return constructor(m3, m2, m1)
            return constructor(m2, m1)

    return fuser_method

    Creates fuser method from class constructor of fused modules.
    
coremltools/optimize/torch/quantization/_backend_config_utils.py