-
Notifications
You must be signed in to change notification settings - Fork 1
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 #1
Add unit test #1
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.
Could you also add more information to the assert messages?
python/mxnet/test_utils.py
Outdated
Whether two NDArrays share the same memory | ||
""" | ||
array1[:] += 1 | ||
if(not np.array_equal(array1.asnumpy(), array2.asnumpy())): |
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.
Use test_utils.same(array1.asnumpy(), array2.asnumpy)
to keep the unit test interface consistent.
python/mxnet/test_utils.py
Outdated
""" | ||
array1[:] += 1 | ||
if(not np.array_equal(array1.asnumpy(), array2.asnumpy())): | ||
return False |
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.
Change the value of array1 back before return False.
python/mxnet/test_utils.py
Outdated
if(not np.array_equal(array1.asnumpy(), array2.asnumpy())): | ||
return False | ||
array1[:] -= 1 | ||
return np.array_equal(array1.asnumpy(), array2.asnumpy()) |
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.
Use test_utils.same
tests/python/unittest/test_module.py
Outdated
@@ -254,6 +255,79 @@ def mean_abs(x): | |||
break | |||
assert(mon_result_counts == [2, 2, 1, 6, 6, 4]) | |||
|
|||
def test_executor_group(): | |||
def test_exec_group_create(origin_exec_grp, shared_exec_grp, |
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.
In this test, group1 is shared_group for group2/3.
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Add unit test * Fix * Small fix
* Initial checkin Add init functions for simple bind in graph_executor Add simple_bind c_api Add simple bind c-api Assign zeros to in_args, arg_grads, and aux_states Add simple_bind2 python interface Fix python interface bugs Interface changes Fix Fix core dump Add bind_ith_exec c_api Change simple_bind2 Fix seg fault Finish simple_bind Change _bind_ith_exec Refactor simple_bind initialization flow for bind Consolidate bind and simple_bind graph init flow Fix bug Clean up Add comments Clean up Clean up Minor correction Rename APIs in graph executor Refactor Rebase Delete deprecated functions Move more front-end work to backend Bug fix Fix failed tests Minor fix Fix lint Fix lint Revert unnecessary changes Revert Revert Clean up Fix lint Fix bind_ith_exec calling simple_bind Fix bugs for _bind_ith_exec * Add unit test (#1) * Add unit test * Fix * Small fix * Fix lint * Fix lint * Fix bugs of missing ndarrays in shared_buffer * Fix lint * Simple bind (#3) * Add bucketing test * Skip pylint * Use cpu to train * Fix bug * Remove merge message * Fix lint * Add logging to test_bucketing.py * Reduce model size (#4) * Add checks for shape/type inferences * Add printing error messages for shape/type inference failure
…pache#9688) * bilinear upsample from PYTorch * fix cpu backward * fix indent, add req * fix lint * fix lint * lint * handle req * add adaptive avg pooling operator * rename to bilinear resize * fix name * change assertion * rm unused var * refactor using mshadow tensor * rm devicetensor, only using mshadow * add docs * naming * merge * Revert "merge" This reverts commit a2a809a. * add unit test for BilinearResize2D and AdaptiveAvgPool2D * for test in python2, cast into float * mv function inside * link docs * address the comments * lint * add back private () * correct lint * decleare var * link params docs * fix bug * mv to contrib and upodate docs * contrib header * change include path for contrib * lint * register to contrib * lint * rename width, height, docs * rename param * Patch1 (#1) * two shapes input * docs * typo * lint * lint
@reminisce