Fix bug in handling of inputs_name, a mix happened between name provided by...
Context
I am working on a case like this:
flowchart TD
ONNX1 --> CustomOp --> ONNX2
I have a script that was previously working but with current version it no longer work.
The script now produce an ONNX with no connexion between ONNX1 CustomOp and ONNX2.
This is due to the introduction of inputName and outputName.
Issue 1: Bad handling of nodes with no inputName
Indeed the CustomOp is defined inside my script and does not have a inputName. And since ONNX export now generate connections using this str the nodes are not linked in ONNX.
I have fixed this issue by changing inputName so that the name is defined like so:
- If the node has a parent, use parent.outputName
- If the node as a mOutputName for the inquired input use it
- The node generate an input by following the pattern:
{name}_in{IN_ID}
Issue 2: No handling of duplicate input/outputName
This solve the aforementioned issue, however I am now facing an other issue. In ONNX1 and ONNX2 some edges are named the same way. Creating an invalid graph when fusing them!
Modifications
- rename inputName -> input_name
- rename outputName -> output_name
- Add a make_edge_names_unique function to fix duplicate edge names.
- Simplify handling of Optional input_name by making so that Node return "" if the input is None (instead of having that logic in the export code)
- Fix a bug coming from the confusion of
inputs_name
parameter which contains the node_name and not the input_name of the graph inputs. - Fix minor issues in slice and resize.