-
Notifications
You must be signed in to change notification settings - Fork 175
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
Add unit test framework for operators' conversion #29
Conversation
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.
Already implemented the unit test for conv2d
, pool2d
, mum_op
etc, but not for batch_norm_op
due to its special unit test.
@@ -24,6 +24,6 @@ unittest(){ | |||
trap 'abort' 0 | |||
set -e | |||
|
|||
unittest . | |||
# unittest . |
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.
The unit test in travis-ci is disabled because it requires the installation of caffe2, as the backend of 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.
Yes, seems caffe2 backend is necessary, let me try to add the dependencies in the CI.
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.
@pkuyym the installation of caffe2 always failed in local machine, and seems that it is very sensitive to the dependencies, e.g. version of cmake
, protobuf
etc. You can find if there is a robust way, so that we can integrate it in CI. Thanks!
'use_mkldnn': self.use_mkldnn | ||
} | ||
|
||
output = np.zeros((1, 1, 1, 1)) |
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.
output
is a placeholder, and can be any shape and any value.
|
||
self.inputs = {'Input': input, 'Filter': filter} | ||
|
||
self.persistable = ['Filter'] |
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 list of persistable vars, usually indicating the parameters
Really enjoying this PR... comments coming soon.. |
There's a lot of good things going on here. Before I proceed, have you considered adding |
@varunarora of course. Done adding |
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.
One small comment, but apart from that, this looks great!
for name, np_value in self.inputs[var_name]: | ||
tensor = core.LoDTensor() | ||
if isinstance(np_value, tuple): | ||
tensor.set(np_value[0], place) |
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.
It would be nice to make new function for this code that repeats twice doing the .set
s
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.
It is true. I will fix it in next pull request.
@varunarora I saw the comments you added and learn a lot from them. This is a good practice. Many thanks! |
* add base test case * add run script * update * add pytest configruation
Fix #28