aaronmarkham commented on a change in pull request #14919: Add API 
documentation for upsampling operator with examples
URL: https://github.com/apache/incubator-mxnet/pull/14919#discussion_r282628667
 
 

 ##########
 File path: src/operator/nn/upsampling.cc
 ##########
 @@ -121,9 +121,67 @@ struct UpSamplingGrad {
 DMLC_REGISTER_PARAMETER(UpSamplingParam);
 
 NNVM_REGISTER_OP(UpSampling)
-.describe("Performs nearest neighbor/bilinear up sampling to inputs. "
-          "Bilinear upsampling makes use of deconvolution. Therefore, "
-          "provide 2 inputs - data and weight. ")
+.describe(R"code(Upsamples the given input data.
+
+2 algorithms (``sample_type``) are available for upsampling
+
+- Nearest Neighbor
+- Bilinear
+
+**Nearest Neighbor Upsampling**
+
+Input data is expected to be 4D of the form `(batch, channel, height, width)`.
+
+Example::
+
+  >>> x = nd.ones((1,1,3,3))
+  >>> x
+  [[[[1. 1. 1.]
+     [1. 1. 1.]
+     [1. 1. 1.]]]]
+  <NDArray 1x1x3x3 @cpu(0)>
+  >>> upsampled_x = nd.UpSampling(x, scale=2, sample_type='nearest') 
+  >>> upsampled_x
+  [[[[1. 1. 1. 1. 1. 1.]
+     [1. 1. 1. 1. 1. 1.]
+     [1. 1. 1. 1. 1. 1.]
+     [1. 1. 1. 1. 1. 1.]
+     [1. 1. 1. 1. 1. 1.]
+     [1. 1. 1. 1. 1. 1.]]]]
+  <NDArray 1x1x6x6 @cpu(0)>
+
+**Bilinear Upsampling**
+
+Uses `deconvolution` algorithm under the hood. You need provide both input 
data and the kernel.
+
+Input data is expected to be 4D of the form `(batch, channel, height, width)`.
 
 Review comment:
   Why not just say:
   ```suggestion
   Input data is expected to be NCHW.
   ```

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


With regards,
Apache Git Services

Reply via email to