haojin2 commented on a change in pull request #11587: [MXNET-378] Adding 
depth_to_space and space_to_depth operator(Updated)
URL: https://github.com/apache/incubator-mxnet/pull/11587#discussion_r201524165
 
 

 ##########
 File path: src/operator/tensor/matrix_op.cc
 ##########
 @@ -908,5 +909,96 @@ NNVM_REGISTER_OP(_backward_squeeze)
 .set_attr<nnvm::TIsBackward>("TIsBackward", true)
 .set_attr<FCompute>("FCompute<cpu>", UnaryOp::IdentityCompute<cpu>);
 
+NNVM_REGISTER_OP(depth_to_space)
+.describe(R"code(This operators implements the depthToSpace function:
+.. math::
+    f(x, block) = ~x
+where :math:`x` is an input tensor of shape [N,C,H,W] and `~x` is the output 
tensor of shape [N, C/(block^2), H*block, W*block]
+Example::
+#(1,4,2,3) input tensor
+  x = [[[[0, 1, 2],
+               [3, 4, 5]],
+          [[6, 7, 8],
+               [9, 10, 11]],
+          [[12, 13, 14],
+               [15, 16, 17]],
+          [[18, 19, 20],
+               [21, 22, 23]]]]
+  
+  y = depth_to_space(x, 2)
+
+# (1, 1, 4, 6) output tensor
+  y = [[[[0, 6, 1, 7, 2, 8],
+               [12, 18, 13, 19, 14, 20],
+               [3, 9, 4, 10, 5, 11],
+               [15, 21, 16, 22, 17, 23]]]]
+)code" ADD_FILELINE)
 
 Review comment:
   Rendering of documentation is problematic as per your latest successful 
build 
(http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-11587/4/api/python/ndarray/ndarray.html?highlight=space_to_depth#mxnet.ndarray.space_to_depth),
 you need to insert extra lines and inspect the rendering of docs by referring 
to the following instruction in the description section: "Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html";

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to