def METHOD_NAME(self, g):
    has_update = True
    while has_update:
        has_update = False
        nodes = [n for n in g.get_nodes() if n.type == "Loop"]
        for n in nodes:
            has_update_tmp = self._try_move_transpose_out_of_body_graph(n)
            if has_update_tmp:
                has_update = True
                self.graph_been_opt = True
    return g