def remove_elementwise_no_ops(
    sorted_graph: List[Tensor], workdir: str = None
) -> List[Tensor]:
    """elementwise no-ops (*/1, +-0)"""
    for tensor in sorted_graph:
        src_ops = tensor._attrs["src_ops"]
        if len(src_ops) != 1:
            continue
        src_op = list(src_ops)[0]

        if (
            src_op._attrs["op"] != "elementwise"
            or src_op._attrs["func"] not in FUNC_TO_PREDICATE_MAP
            or len(src_op._attrs["args"]) != 2  # Skip legacy usecase
        ):
            continue

        predicate = FUNC_TO_PREDICATE_MAP[src_op._attrs["func"]]
        if not predicate(src_op):
            continue

        input_tensor = src_op._attrs["inputs"][0]
        # skip a very special case where ops takes an input and produces an output
        if tensor._attrs["is_output"] and input_tensor._attrs["is_input"]:
            continue
        transform_utils.remove_single_tensor_op_from_sorted_graph(src_op)

    return transform_utils.sanitize_sorted_graph(sorted_graph)
elementwise no-ops (*/1, +-0)
python/aitemplate/compiler/transform/remove_elementwise_no_ops.py