def _find_conv_or_gemm_swish_fusion_node(node):
    r"""
    Check whether has conv/gemm_sigmoid_mul fusion before cur node(including).
        conv/gemm
          /  \
         /  sigmoid
         \     /
           mul(_)
    """
    mul_ops = [str(torch.mul), str(torch.Tensor.mul), str(torch.Tensor.mul_)]
    sigmoid_ops = [
        str(torch.Tensor.sigmoid),
        str(torch.Tensor.sigmoid_),
        str(torch.sigmoid),
        str(torch.sigmoid_),
        str(F.sigmoid),
        str(torch.nn.Sigmoid),
    ]
    if node.type in mul_ops and len(node.pre_nodes) == 2:
        if (
            node.pre_nodes[0].type in conv_gemm_ops
            and node.pre_nodes[1].type in sigmoid_ops
        ):
            if (
                len(node.pre_nodes[0].post_nodes) == 2
                and len(node.pre_nodes[1].post_nodes) == 1
                and node.pre_nodes[1] in node.pre_nodes[0].post_nodes
            ):
                return node.pre_nodes[0]
        elif (
            node.pre_nodes[1].type in conv_gemm_ops
            and node.pre_nodes[0].type in sigmoid_ops
        ):
            if (
                len(node.pre_node[1].post_nodes) == 2
                and len(node.pre_nodes[0].post_nodes) == 1
                and node.pre_nodes[0] in node.pre_node[1].post_nodes
            ):
                return node.pre_nodes[1]
    return None

    Check whether has conv/gemm_sigmoid_mul fusion before cur node(including).
        conv/gemm
          /  \
         /  sigmoid
         \     /
           mul(_)
    
intel_extension_for_pytorch/quantization/_recipe.py