diff --git a/aidge_core/show_graphview.py b/aidge_core/show_graphview.py index f6358643990691e910195bd7d951dde324a8d33f..9fcde55732c3c21c922d0e03f627c4ef66df8ab2 100644 --- a/aidge_core/show_graphview.py +++ b/aidge_core/show_graphview.py @@ -96,9 +96,9 @@ def create_dict(sorted_nodes : list[aidge_core.Node], write_trainable_params_ext :type write_trainable_params_ext: bool :param write_trainable_params_embed: Whether or not to write the eventual trainable parameters of the Nodes in the same file as the dict (embed). :type write_trainable_params_embed: bool - :param params_file_format: Format of the external file used to store the Nodes' trainable parameters. Options: 'npz' or 'json'. + :param params_file_format: Format of the external file used to store the Nodes' trainable parameters. Options: ``npz`` or ``json``. :type params_file_format: str - :param path_trainable_params: Path of the external file used to store the Nodes' trainable parameters. Options: 'npz' or 'json'. + :param path_trainable_params: Path of the external file used to store the Nodes' trainable parameters. :type path_trainable_params: str :return: A dictionary with the GraphView description. @@ -165,7 +165,7 @@ def create_dict(sorted_nodes : list[aidge_core.Node], write_trainable_params_ext # Check if my node is a metaop attributes_dict = {} - if hasattr(node.get_operator(), 'get_micro_graph'): + if isinstance(node.get_operator(), aidge_core.MetaOperator_Op): attributes_dict['micro_graph'] = [] for micro_node in node.get_operator().get_micro_graph().get_nodes(): micro_node_dict = {'name' : micro_node.name(), @@ -239,13 +239,11 @@ def gview_to_json(gview : aidge_core.GraphView, json_path : str, write_trainable :param json_path: Path to write JSON file. :type json_path: str :param write_trainable_params_ext: Whether or not to write the eventual trainable parameters of the Nodes in an external file. - :type write_trainable_params_ext: bool + :type write_trainable_params_ext: bool, optional :param write_trainable_params_embed: Whether or not to write the eventual trainable parameters of the Nodes in the same file as the dict (embed). - :type write_trainable_params_embed: bool - :param params_file_format: Format of the external file used to store the Nodes' trainable parameters. Options: 'npz' or 'json'. - :type params_file_format: str - :param path_trainable_params: Path of the external file used to store the Nodes' trainable parameters. Options: 'npz' or 'json'. - :type path_trainable_params: str + :type write_trainable_params_embed: bool, optional + :param params_file_format: Format of the external file used to store the Nodes' trainable parameters. Options: ``npz`` or ``json``. Default = ``json``. Requires ``write_trainable_params_ext``. + :type params_file_format: str, optional """ @@ -266,12 +264,4 @@ def gview_to_json(gview : aidge_core.GraphView, json_path : str, write_trainable # Write dict to json write_dict_json(graphview_dict, json_path) - return None - - - - - - - - + return None \ No newline at end of file