endvroy commented on a change in pull request #15371: numpy compatible dsplit
operator
URL: https://github.com/apache/incubator-mxnet/pull/15371#discussion_r303276891
##########
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()
[email protected]_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:
fixed
----------------------------------------------------------------
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