Skip to content

Output gradients in export_testcase #116

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

Merged
merged 5 commits into from
Mar 1, 2019
Merged

Output gradients in export_testcase #116

merged 5 commits into from
Mar 1, 2019

Conversation

ir5
Copy link
Contributor

@ir5 ir5 commented Feb 28, 2019

I implemented new option in export_testcase to output gradients as well. This may be useful for the development of chainer-compiler.

@ir5
Copy link
Contributor Author

ir5 commented Feb 28, 2019

I noticed that the name of gradient files should be consistent with the names in .onnx file, which is based on str(id(param)). I'll change this code.

@ir5
Copy link
Contributor Author

ir5 commented Mar 1, 2019

After #118 is merged, str(id(param)) part should be reverted to namedparams.

@shinh
Copy link
Member

shinh commented Mar 1, 2019

LGTM, but how about adding a simple test?

@ir5
Copy link
Contributor Author

ir5 commented Mar 1, 2019

Sure, I'll try to write a simple test.

@ir5
Copy link
Contributor Author

ir5 commented Mar 1, 2019

Added some test for export_testcase. The test just checks the existence of generated .pb files.


def test_export_testcase(self):
# Just check the existence of pb files
path = 'out/test_export_testcase'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code works on Windows, but it's better to use os.path.join and "out" is got from onnx_chainer.testing.test_onnxruntime.TEST_OUT_DIR. However related to this directory will be fixed in #117 and next PR , so it's fine like this.

@shinh shinh merged commit 167b308 into chainer:master Mar 1, 2019
@disktnk disktnk added this to the 1.3.3 milestone Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants