def module_call_to_function_call(module, args, weights):
    r"""
    This function is a help function which replace nn.module call to funtion call, which implement
    the nn.module's forward function.
    """
    if isinstance(module, torch.nn.Conv2d) or isinstance(module, torch.nn.Conv3d):
        output = module._conv_forward(args[0], weights[0], module.bias)
    elif isinstance(module, torch.nn.Linear):
        output = F.linear(args[0], weights[0], module.bias)
    elif isinstance(module, torch.nn.EmbeddingBag):
        output = F.embedding_bag(
            args[0],
            weights[0],
            args[1],
            module.max_norm,
            module.norm_type,
            module.scale_grad_by_freq,
            module.mode,
            module.sparse,
            args[2] if len(args) == 3 else None,
            module.include_last_offset,
            module.padding_idx,
        )
    elif isinstance(module, MergedEmbeddingBagWithCat):
        output = torch.ops.torch_ipex.merged_embeddingbag_cat_forward(
            weights, args[0], args[1], args[2]
        )
    elif isinstance(module, torch.nn.ConvTranspose2d) or isinstance(
        module, torch.nn.ConvTranspose3d
    ):
        if module.padding_mode != "zeros":
            raise ValueError(
                "Only `zeros` padding mode is supported for ConvTranspose2d"
            )
        assert isinstance(module.padding, tuple)
        # One cannot replace List by Tuple or Sequence in "_output_padding" because
        # TorchScript does not support `Sequence[T]` or `Tuple[T, ...]`.
        output_size = args[1] if len(args) == 2 else None
        # master code
        """
        num_spatial_dims = 2 if isinstance(module, torch.nn.ConvTranspose2d) else 3
        output_padding = module._output_padding(args[0], output_size,
                        module.stride, module.padding, module.kernel_size,
                        num_spatial_dims, module.dilation)
        """
        output_padding = module._output_padding(
            args[0],
            output_size,
            module.stride,
            module.padding,
            module.kernel_size,
            module.dilation,
        )
        # output_padding = module._output_padding(*arg_to)
        if isinstance(module, torch.nn.ConvTranspose2d):
            output = F.conv_transpose2d(
                args[0],
                weights[0],
                module.bias,
                module.stride,
                module.padding,
                output_padding,
                module.groups,
                module.dilation,
            )
        else:
            output = F.conv_transpose3d(
                args[0],
                weights[0],
                module.bias,
                module.stride,
                module.padding,
                output_padding,
                module.groups,
                module.dilation,
            )
    elif isinstance(module, torch.nn.LSTM):
        output = _lstm_forward(
            module, args[0], args[1] if len(args) == 2 else None, weights
        )
    return output

    This function is a help function which replace nn.module call to funtion call, which implement
    the nn.module's forward function.
    
intel_extension_for_pytorch/quantization/_utils.py