From 0aad083cec921759e9440b54f5afe26c45fd94a5 Mon Sep 17 00:00:00 2001 From: Axel Farrugia <axel.farrugia@cea.fr> Date: Tue, 18 Mar 2025 16:57:48 +0100 Subject: [PATCH] [Chore](Exports) Change from test_mode to dev_mode for coherence --- aidge_core/export_utils/scheduler_export.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/aidge_core/export_utils/scheduler_export.py b/aidge_core/export_utils/scheduler_export.py index aaca6b76a..a6b590cb3 100644 --- a/aidge_core/export_utils/scheduler_export.py +++ b/aidge_core/export_utils/scheduler_export.py @@ -6,7 +6,7 @@ from aidge_core.export_utils import ExportLib, generate_file, copy_file, copy_fo from typing import List, Tuple -def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib = None, memory_manager=None, memory_manager_args=None, test_mode=False) -> None: +def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib = None, memory_manager=None, memory_manager_args=None, dev_mode=False) -> None: """Exports an aidge_core.Scheduler to C++ code. This function generates files for a given computation graph, including forward-pass functions, @@ -57,8 +57,12 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib = :type memory_manager: callable :param memory_manager_args: Additional arguments passed to `memory_manager`. Defaults to an empty dictionary. :type memory_manager_args: dict, optional - :param test_mode: Additional argument which may be used during forward generation. - :type test_mode: bool, optional + :param dev_mode: Wether or not the developer mode is enabled. If enabled, the export files + will be symlinks from the aidge export module. Therefore, modifying + a file within the export will change the module as well. + The dev_mode flag is also passed to the forward jinja templates to allow export + customization (ie. Adding a debug mode for instance). + :type dev_mode: bool, optional """ graphview = scheduler.graph_view() export_folder = Path().absolute() / export_folder_path @@ -181,7 +185,7 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib = inputs_dtype=inputs_dtype, outputs_name=outputs_name, outputs_dtype=outputs_dtype, - test_mode=test_mode, + dev_mode=dev_mode, list_node_names=list_node_names ) @@ -199,7 +203,7 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib = inputs_dtype=inputs_dtype, outputs_name=outputs_name, outputs_dtype=outputs_dtype, - test_mode=test_mode + dev_mode=dev_mode ) if len(outputs_name) != len(outputs_dtype) or len(outputs_name) != len(outputs_size): @@ -208,8 +212,8 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib = if export_lib is not None: # Copy all static files in the export for source, destination in export_lib.static_files.items(): - copy_file(source, str(export_folder / destination), test_mode) + copy_file(source, str(export_folder / destination), dev_mode) # Copy all static folders in the export for source, destination in export_lib.static_folders.items(): - copy_folder(source, str(export_folder / destination), test_mode) + copy_folder(source, str(export_folder / destination), dev_mode) -- GitLab