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 2019/07/12 03:47:00 UTC

[GitHub] [incubator-mxnet] haojin2 commented on a change in pull request #15371: numpy compatible dsplit operator

haojin2 commented on a change in pull request #15371: numpy compatible dsplit operator
URL: https://github.com/apache/incubator-mxnet/pull/15371#discussion_r302817980
 
 

 ##########
 File path: tests/python/unittest/test_numpy_op.py
 ##########
 @@ -485,6 +485,55 @@ def hybrid_forward(self, F, a, *args, **kwargs):
             ref_grad, low, high = func_data
             check_unary_func(func, ref_grad, shape, low, high)
 
+@with_seed()
+@npx.use_np_shape
+def test_np_dsplit():
+    @npx.use_np_shape
+    class TestDSplit(HybridBlock):
+        def __init__(self, indices_or_sections):
+            super(TestDSplit, self).__init__()
+            self._indices_or_sections = indices_or_sections
+
+        def hybrid_forward(self, F, a):
+            return F.np.dsplit(a, self._indices_or_sections)
+
+    for hybridize in [True, False]:
+        for shape_x, i_or_s in [
+            ((2, 5, 10, 3), 5),
+            [(2, 3, 4), 2],
+            [(2, 0, 6, 0), 3]  # zero dims
+            # [(2, 0, 6, 0), (2, 3)]  # zero dims
 
 Review comment:
   Get rid of dead code or un-comment to add coverage.

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


With regards,
Apache Git Services