def _get_valid_view_op_and_second_cat(
    view_ops: List[Operator],
) -> Tuple[Operator, Operator]:
    """
    Return the view op and the second cat if we can find such a pair
    """
    view_op = None
    second_cat = None
    for a_view_op in view_ops:
        view_op_output = a_view_op._attrs["outputs"][0]
        next_next_ops = view_op_output._attrs["dst_ops"]
        next_concats = [n for n in next_next_ops if n._attrs["op"] == "concatenate"]
        # only allow a single concat in the view_op's dst_ops
        if len(next_concats) != 1:
            continue
        if _is_valid_cat_op(next_concats[0]):
            view_op = a_view_op
            second_cat = next_concats[0]
            break
    return (view_op, second_cat)
Return the view op and the second cat if we can find such a pair
python/aitemplate/compiler/transform/move_view_ops.py