lupesko commented on a change in pull request #14107: fix nd.slice for 
following outputs: (1) begin=end and (2) end=-1, step=-1
URL: https://github.com/apache/incubator-mxnet/pull/14107#discussion_r255355003
 
 

 ##########
 File path: tests/python/unittest/test_operator.py
 ##########
 @@ -6484,14 +6484,14 @@ def check_slice_axis_partial_infer(data, axis, begin, 
end, expected_out_shape):
         out = mx.sym.slice_axis(data, axis=axis, begin=begin, end=end)
         assert (out.infer_shape_partial()[1][0] == expected_out_shape), 
out.infer_shape_partial()[1]
 
-    var1 = mx.sym.var(name="data", shape=(0, 20))
-    check_slice_partial_infer(var1, (None, None), (None, 10), [], (0, 10))
-    check_slice_partial_infer(var1, (None, None), (None, 10), (None, 2), (0, 
5))
-    check_slice_partial_infer(var1, (None, 3), (None, 10), [], (0, 7))
-    check_slice_partial_infer(var1, (None, 3), (5, 10), [], (0, 7))
-    check_slice_partial_infer(var1, (2, 3), (None, 10), [], (0, 7))
-    check_slice_partial_infer(var1, (2, 3), (None, 10), (None, 1), (0, 7))
-    check_slice_partial_infer(var1, (2, 3), (None, 10), (3, 3), (0, 3))
+    var1 = mx.sym.var(name="data", shape=(10, 20))
+    check_slice_partial_infer(var1, (None, None), (None, 10), [], (10, 10))
+    check_slice_partial_infer(var1, (None, None), (None, 10), (None, 2), (10, 
5))
+    check_slice_partial_infer(var1, (None, 3), (None, 10), [], (10, 7))
+    check_slice_partial_infer(var1, (None, 3), (5, 10), [], (5, 7))
+    check_slice_partial_infer(var1, (2, 3), (None, 10), [], (8, 7))
+    check_slice_partial_infer(var1, (2, 3), (None, 10), (None, 1), (8, 7))
+    check_slice_partial_infer(var1, (2, 3), (None, 10), (3, 3), (3, 3))
 
 Review comment:
   Shouldn't you add a test to assert that `begin=-1 and end=-1` returns an 
error, since you are addressing this edge case? (which fixes #14105 )

----------------------------------------------------------------
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