-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
@wangxinanbook added a fix for the issue in this PR as this issue came while running a model without dims value in params. |
@mxnet-label-bot add [pr-awaiting-review, ONNX] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add Fixes #13300 in the PR description
np_array = to_array(tensor_proto).reshape(tuple(tensor_proto.dims)) | ||
else: | ||
np_array = np.array([to_array(tensor_proto)]) | ||
return nd.array(np_array) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should be outside the else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
da32f75
to
17b14f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
do you think it makes sense to add a unit test for this case? |
17b14f0
to
8eb1ba5
Compare
@nswamy Added test case |
Codecov Report
@@ Coverage Diff @@
## master #13413 +/- ##
==========================================
- Coverage 83.27% 81.24% -2.04%
==========================================
Files 722 724 +2
Lines 79010 80525 +1515
Branches 3223 3229 +6
==========================================
- Hits 65796 65420 -376
- Misses 12344 14232 +1888
- Partials 870 873 +3
Continue to review full report at Codecov.
|
* fix for params with no dims * fix * fix * retrigger build * test added * retrigger CI * retrigger ci
Description
input tensor_proto can be a numeric variable and sometimes it can have tensor_proto.dims parameter empty. In this case, as the shape cannot be infered, and reshape will throw an error. Adding a fix for it
Fixes #13300
@thomelane @vandanavk
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.