    def add_subgraph(self, sgraph):
        """Adds an subgraph object to the graph.

        It takes a subgraph object as its only argument and returns
        None.
        """
        if not isinstance(sgraph, Subgraph) and not isinstance(sgraph, Cluster):
            raise TypeError(
                "add_subgraph() received a non subgraph class object:" + str(sgraph)
            )

        if sgraph.get_name() in self.obj_dict["subgraphs"]:
            sgraph_list = self.obj_dict["subgraphs"][sgraph.get_name()]
            sgraph_list.append(sgraph.obj_dict)

        else:
            self.obj_dict["subgraphs"][sgraph.get_name()] = [sgraph.obj_dict]

        sgraph.set_sequence(self.get_next_sequence_number())
        sgraph.set_parent_graph(self.get_parent_graph())
Adds an subgraph object to the graph.

It takes a subgraph object as its only argument and returns
None.
python/aitemplate/utils/visualization/pydot.py