You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/12/20 22:48:28 UTC

[GitHub] anirudh2290 commented on a change in pull request #13611: add image resize operator and support batch_size

anirudh2290 commented on a change in pull request #13611: add image resize operator and support batch_size
URL: https://github.com/apache/incubator-mxnet/pull/13611#discussion_r243439489
 
 

 ##########
 File path: tests/python/unittest/test_gluon_data_vision.py
 ##########
 @@ -44,6 +47,38 @@ def test_normalize():
     data_expected[:][:][2] = data_expected[:][:][2] - 2.0
     assert_almost_equal(data_expected, out_nd.asnumpy())
 
+@with_seed()
+def test_resize():
+    # test normal case
+    data_in = nd.random.uniform(0, 255, (300, 200, 3)).astype('uint8')
+    out_nd = transforms.Resize(200)(data_in)
+    data_expected = image.imresize(data_in, 200, 200, 1)
+    assert_almost_equal(out_nd.asnumpy(), data_expected.asnumpy())
+    # test 4D input
+    data_bath_in = nd.random.uniform(0, 255, (3, 300, 200, 3)).astype('uint8')
 
 Review comment:
   can we test for one other dtype apart from uint8

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services