-
Notifications
You must be signed in to change notification settings - Fork 105
Two fixes addressing issue 723 #743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Two fixes addressing issue 723 #743
Conversation
- Using a non-two-D Convolution Layer now gives an error message - If the layer sizes are stored in INT64 instead of INT32, this now works
MatthewDaggitt
left a comment
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.
Thanks for the PR! Generally looks great, but a few comments.
| TensorShape inputShape = _shapeMap[inputNodeName]; | ||
|
|
||
| // Added: Check if convolutional layers are only 2D | ||
| if (inputShape.size()!=4) { |
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.
Very minor but this should be laid out as:
if ( inputShape.size() != 4 )
{
and tabs should be four spaces. Can you check that this style is used everywhere?
| result.append( value ); | ||
| } | ||
| } else { | ||
| String errorMessage = Stringf( "Illegal data type for integer tensors used in the model. Only INT32 and INT64 supported." ); |
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 should be "unsupported" not "illegal"?
| } else { | ||
| String errorMessage = Stringf( "Illegal data type for integer tensors used in the model. Only INT32 and INT64 supported." ); | ||
| throw MarabouError( MarabouError::ONNX_PARSER_ERROR, errorMessage.ascii() ); | ||
| } |
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.
I think you also need to add a corresponding case for the else below when the data is not stored in raw_data. I'd advice lifting the dataType check above the raw_data check.
|
@progirep Thank you so much for your code contribution. I have two requests (sorry for the trouble)!
|
This is supposed to address issue 723: #723
There are two changes:
The current code is not clean in that probably the error message formatting is not exactly how this is envisioned in the project, the code formatting is not great, and data types are not checked uniformly. The additional checks for data types probably make the overall code a tiny bit slower, but not much.