Skip to content
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

Merged
merged 3 commits into from
May 23, 2017
Merged

Conversation

kevinthesun
Copy link

Copy link
Owner

@reminisce reminisce left a 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?

Whether two NDArrays share the same memory
"""
array1[:] += 1
if(not np.array_equal(array1.asnumpy(), array2.asnumpy())):
Copy link
Owner

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.

"""
array1[:] += 1
if(not np.array_equal(array1.asnumpy(), array2.asnumpy())):
return False
Copy link
Owner

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.

if(not np.array_equal(array1.asnumpy(), array2.asnumpy())):
return False
array1[:] -= 1
return np.array_equal(array1.asnumpy(), array2.asnumpy())
Copy link
Owner

Choose a reason for hiding this comment

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

Use test_utils.same

@@ -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,
Copy link
Owner

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.

@reminisce reminisce merged commit e856edf into reminisce:improve_symbol_bind May 23, 2017
reminisce pushed a commit that referenced this pull request May 24, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request May 26, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request May 26, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request May 30, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request May 30, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request May 31, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request May 31, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request Jun 1, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request Jun 1, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request Jun 2, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request Jun 2, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request Jun 2, 2017
* Add unit test

* Fix

* Small fix
reminisce pushed a commit that referenced this pull request Jun 3, 2017
* Add unit test

* Fix

* Small fix
reminisce added a commit that referenced this pull request Jun 6, 2017
* 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
reminisce pushed a commit that referenced this pull request Apr 26, 2018
…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
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.

2 participants