def is_parent(op1: Operator, op2: Operator) -> bool:
    """
    Returns whether op1 is a parent of op2.
    """

    for tensor in op2._attrs["inputs"]:
        if op1 in tensor._attrs["src_ops"]:
            return True
    return False
Returns whether op1 is a parent of op2.
python/aitemplate/compiler/transform/transform_utils.py