[Scheduler] fix internal issue when scheduling producer nodes
Context
This is a fix for a "bug" discovered in aidge_backend_cpu
unit tests on scheduler forward
, the bug also appears in some
ONNX import+forward tests.
Refer to the bug report done in aidge_backend_cpu
: aidge_backend_cpu#29
Actually with the change introduced in @e3d14f15 Producer
nodes may be considered as consumers in the main loop of generateBaseScheduling
.
But the function summarizeConsumerState
is not protected against node with no input or no output.
This MR is a simple fix to this function to account for case of 0-inputs or 0-outputs.
The case where graph may generate these bugs are for instance single node Producer graph:
- one single Producer noe
- one single graph output (the producer node)
These graphs are "degenerate" but may be generated as unit tests for ONNX Constant node for instance which will generate a single Producer node.
Or in the aidge_backend_cpu
test_scheduler.py
test, which is itself buggy (ref to the bug report above), and which give to the scheduler an unconnected Producer node to schedule.
Modified files
- Scheduler.cpp: simple fix to the
summarizeConsumerState
function
Detailed major modifications
none
TODO
none