-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-1400]adding large tensor support tests for depth_to_space and space_to_depth #14797
Conversation
@mxnet-label-bot add [pr-awaiting-review] |
@apeforest : please review |
data_np = data.asnumpy() | ||
output = mx.nd.depth_to_space(data, 2) | ||
|
||
def test_spacetodepth(): |
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.
what are you testing here?
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.
Have added test cases to compare with numpy implementation
@@ -185,7 +186,19 @@ def test_pick(): | |||
b = mx.nd.ones(shape=(256*35,)) | |||
res = mx.nd.pick(a,b) | |||
assert res.shape == b.shape | |||
|
|||
|
|||
def test_depthtospace(): |
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.
what are you testing here?
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.
Have added test cases to compare with numpy implementation
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.
nit: rename to test_depth_to_space
tests/nightly/test_large_array.py
Outdated
data = rand_ndarray(shape_inp, 'default') | ||
data_np = data.asnumpy() | ||
output = mx.nd.space_to_depth(data, 2) | ||
mx.nd.waitall() |
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.
no need waitall here. You can use output.asnumpy()
6937f3a
to
bddb90e
Compare
tests/nightly/test_large_array.py
Outdated
|
||
|
||
def test_depthtospace(): | ||
def f(x, blocksize): |
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.
What does this method do? Use a meaningful name.
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.
I have updated the names of the function
tests/nightly/test_large_array.py
Outdated
assert_almost_equal(output.asnumpy(), expected, atol=1e-3, rtol=1e-3) | ||
|
||
def test_spacetodepth(): | ||
def f(x, blocksize): |
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.
What does this method do? Use a meaningful name.
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.
I have updated the names of the function
tests/nightly/test_large_array.py
Outdated
|
||
|
||
def test_depthtospace(): | ||
def depthtospace_using_numpy(x, blocksize): |
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.
nit: rename to numpy_depth_to_space
tests/nightly/test_large_array.py
Outdated
assert_almost_equal(output.asnumpy(), expected, atol=1e-3, rtol=1e-3) | ||
|
||
def test_spacetodepth(): | ||
def spacetodepth_using_numpy(x, blocksize): |
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.
nit: rename to numpy_space_to_depth
…pth_to_space and space_to_depth
@mxnet-label-bot add [pr-awaiting-merge] |
…pth_to_space and space_to_depth (apache#14797)
Description
This PR adds large tensor test cases for 2 more ops mentioned in the title.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.