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

[Feat](Exports) Add a function to remove the optional inputs from the inputs...

[Feat](Exports) Add a function to remove the optional inputs from the inputs list so they are not exported
parent 341d5dab
No related branches found
No related tags found
3 merge requests!414Update version 0.5.1 -> 0.6.0,!408[Add] Dropout Operator,!369[Feat](Exports) Minor features for export generation
...@@ -4,3 +4,4 @@ from .export_registry import ExportLib ...@@ -4,3 +4,4 @@ from .export_registry import ExportLib
from .scheduler_export import scheduler_export from .scheduler_export import scheduler_export
from .tensor_export import tensor_to_c, generate_input_file from .tensor_export import tensor_to_c, generate_input_file
from .generate_main import generate_main_cpp, generate_main_compare_cpp from .generate_main import generate_main_cpp, generate_main_compare_cpp
from .export_utils import remove_optional_inputs
import aidge_core
def remove_optional_inputs(graph_view: aidge_core.GraphView):
""" Remove optional inputs from the ordered_list of the model
There are 3 inputs categories :
- 0 : Data
- 1 : Parameters
- 2 : Optional Inputs
:param graph_view: An instance of :py:class:`aidge_core.graph_view`, providing access to nodes and
ordered input/output data within the computational graph.
:type graph_view: aidge_core.graph_view
"""
inputNodes = []
for n in graph_view.get_ordered_inputs():
if n[0].get_operator().input_category(n[1]) in [aidge_core.InputCategory(0), aidge_core.InputCategory(1)]:
inputNodes.append(n)
graph_view.set_ordered_inputs(inputNodes)
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