Skip to content
Snippets Groups Projects
Commit 0aad083c authored by Axel Farrugia's avatar Axel Farrugia
Browse files

[Chore](Exports) Change from test_mode to dev_mode for coherence

parent e6365f89
No related branches found
No related tags found
2 merge requests!408[Add] Dropout Operator,!369[Feat](Exports) Minor features for export generation
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment