vandanavk commented on a change in pull request #14035: [WIP] Fix documentation 
for bilinear upsampling and add unit test
URL: https://github.com/apache/incubator-mxnet/pull/14035#discussion_r258125213
 
 

 ##########
 File path: tests/python/unittest/test_operator.py
 ##########
 @@ -1491,17 +1491,30 @@ def check_nearest_upsampling_with_shape(shapes, scale, 
root_scale):
         assert_allclose(arr[name].asnumpy()*root_scale**2*scale**(2*k), 
arr_grad[name].asnumpy(), rtol=1e-4)
 
 
-def check_bilinear_upsampling_with_shape(shapes, scale, root_scale):
-    arr = {'arg_%d'%i: mx.random.uniform(-10.0, 10.0, shape, 
ctx=mx.cpu()).copyto(default_context()) for i, shape in zip(range(len(shapes)), 
shapes)}
-    arr_grad = {'arg_%d'%i: mx.nd.zeros(shape) for i, shape in 
zip(range(len(shapes)), shapes)}
-
-    up = mx.sym.UpSampling(*[mx.sym.Variable('arg_%d'%i) for i in 
range(len(shapes))], sample_type='bilinear', scale=root_scale)
+def check_bilinear_upsampling_with_shape(data_shape, weight_shape, scale, 
root_scale, num_filter):
 
 Review comment:
   @apeforest the unit test was not being called previously. And based on 
inputs from the issues in Ref section of the PR description, many users are 
confused about how to use the Upsampling operator with the bilinear upsampling 
option. So i thought I could add/modify tests here as well - which would show 
how to use the operator. 
   I have updated the PR title - should I open a separate PR instead?
   
   Note: This PR is WIP as an assert has to be added at the end of the test. 
Based on an offline discussion with @anirudh2290 yesterday, the assert will be 
similar to what was done for test_deconvolution()

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to