-
-
Notifications
You must be signed in to change notification settings - Fork 69
Conversation
Tanks for the PR. The test fails because the test constant creates an empty graph which is not handled by Gorgonia (obviously). The source of the failing test is:
which comes from this test https://github.com/onnx/onnx/tree/master/onnx/backend/test/data/node/test_constant The problem is that the graph is composed of a single node which does not have any input. It is normal for a constant to not have any input, but an operator should. My opinion is that a constant should not be considered as an operator. the ONNX team seemed to disagree :D https://github.com/onnx/onnx/blob/master/docs/Operators.md#constant I will investigate to see if it is something that can be easily fixed. |
Probably, we can test ssd if onnx-go support constant and unsqueeze. |
The official onnx project gave a reply to the issue 2274 regarding the constant operator. As expected, the IR will not change (indeed, It would have been a surprise that they change it for us). Therefore we may need to address this particular case. Two other operators have the same behavior:
By now, I have no idea how to fix this in an idiomatic way.
WDYT? |
So do you think Constant should always return empty? |
TBH I don't know anymore. I thought we could do a particular case in the decoder to handle the "Constant operator" and turn it into an initializer. The Gorgonia's ExprGraph would have been valid and composed of a single node. But this will not work for the other input-less operators. Another option is to fake an input by creating a new node of type The resulting graph would look like:
Then within Gorgonia, we create an operator that overwrites its input (see the godoc of the Op interface, the method should return 0). I don't know if my explanation is clear enough, though. If it is not, I can try to quickly implement the |
I have created issue #131 to follow the implementation as well as a branch. |
Codecov Report
@@ Coverage Diff @@
## master #116 +/- ##
=========================================
+ Coverage 85.19% 85.2% +0.01%
=========================================
Files 394 395 +1
Lines 10434 10445 +11
=========================================
+ Hits 8889 8900 +11
Misses 1338 1338
Partials 207 207
Continue to review full report at Codecov.
|
Fix with PR #132 |
No description provided.