-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Add test to check that binded is not set when exception thrown #12167
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.
Thanks for your contributions!
tests/python/unittest/test_module.py
Outdated
|
||
mod = mx.mod.Module(sym, ('data',), None, context=[mx.cpu(0), mx.cpu(1)]) | ||
assertRaises(TypeError, mod.bind, data_shapes=[('data', mx.nd.array([10,10]))]) | ||
mod.binded = 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.
you intended assert mod.binded == False?
tests/python/unittest/test_module.py
Outdated
mod.binded = False | ||
|
||
mod.bind(data_shapes=[('data', (10,10))]) | ||
mod.binded = True |
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.
you intended assert mod.binded == True?
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.
wow...thanks lol
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.
LGTM.
Thanks!
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.
LGTM. Test for #12155
apache#12167)" This reverts commit f737cac.
…e#12167) * add test to check binded is not when exception thrown * add error to assertion * fix typo by adding asserts * retrigger
Description
Added test for the previous PR #12155 that set binded flag after setup complete.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments