def remove_tensor_from_sorted_graph(tensor: Tensor) -> None:
    """
    Disconnects the tensor from others so that sanitize_sorted_graph()
    could remove it.
    """
    tensor._attrs["src_ops"] = StableSet()
    tensor._attrs["dst_ops"] = StableSet()
    tensor._attrs["is_input"] = False
    tensor._attrs["is_output"] = False

    Disconnects the tensor from others so that sanitize_sorted_graph()
    could remove it.
    
python/aitemplate/compiler/transform/transform_utils.py