def _find_fused_node_with_cur_elt_wise(node, ops):
    r"""
    Find a node before cur elt_wise which can be fused with cur elt_wise, which used by check
    whether has a op can be fused with elt_wise.
    """
    if len(node.pre_nodes) == 0:
        return None
    pre_node = node.pre_nodes[0]
    if pre_node is not None:
        if pre_node.type in ops:
            if len(pre_node.post_nodes) == 1:
                return pre_node
            elif len(node.post_nodes) == 1 and _find_conv_or_gemm_swish_fusion_node(
                node.post_nodes[0]
            ):
                # conv+sigmoid+mul
                return pre_node
            else:
                return None
        elif (
            pre_node.type in ([str(nn.Identity)] + elt_wise_q_ops + elt_wise_noq_ops)
            and len(pre_node.post_nodes) == 1
            and len(pre_node.pre_nodes) > 0
        ):
            return _find_fused_node_with_cur_elt_wise(pre_node.pre_nodes[0], ops)
        else:
            return None
    else:
        return None

    Find a node before cur elt_wise which can be fused with cur elt_wise, which used by check
    whether has a op can be fused with elt_wise.
    
intel_extension_for_pytorch/quantization/_recipe.py