def _find_original_tensor(tensor: Tensor):
    """Find the original tensor of a tensor view recursively."""
    view = tensor._attrs["is_view_of"]
    if not view:
        return tensor
    return _find_original_tensor(view)
Find the original tensor of a tensor view recursively.
python/aitemplate/compiler/transform/memory_planning.py