def _is_same_op_type(op_A: Operator, op_B: Operator):
    """
    Compare whether 2 ops are of same type.
    """
    if op_A._attrs["op"] != op_B._attrs["op"]:
        return False
    if op_A._attrs["op"] == "elementwise":
        if op_A._attrs["func"] != op_B._attrs["func"]:
            return False

    return True
Compare whether 2 ops are of same type.
python/aitemplate/compiler/transform/fuse_utils.py