feat : better support for onnx graph import and inputs/outputs
Context
Add some corner test cases and fix ONNX model import for managing better:
- multiple reference of the same output name
- ordering of inputs and outputs, when some are ignored/unused/undefined they are ignored in the final Aidge ordered inputs/outputs list,
- forward references of output names, resolved to the first forward definition (allows cyclic graphs)
- multiple references to inputs, for which some identity nodes must be created
Actually the transformation to the input ONNX schedules data dependence graph, expected to be a topological order of nodes, to the Aidge data flow graph (static single definitions) is now done in a separate functions which computes and unambiguous DFG given the above choices.
Modified files
First commit:
-
test_unit_cases_import.py
/test_unit_cases_import_forward.py
: new file adding some unit test cases for corner cases -
onnx_helpers.py
: add utility function for creating ONNX graph from simple test cases described as dict -
test_import_export.py
: minor changes
Second commit:
-
onnx_import.py
: add_get_dataflow_graph()
function and rewrite import. All previously importable graphs are still importable. - update test cases now passing
Detailed major modifications
The ONNX import now defined the ordered inputs, through set_ordered_inputs
.
Add new tests with corner cases in new test files: test_unit_cases_import.py
/test_unit_cases_import_forward.py
TODO
-
Merge or iterate over MR !75 (merged) and MR !76 (merged) first
Edited by Christophe Guillon