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/03/14 18:44:09 UTC
[GitHub] [incubator-mxnet] apeforest commented on a change in pull request
#14403: Fix slice op issues #13760 and #14105
apeforest commented on a change in pull request #14403: Fix slice op issues #13760 and #14105
URL: https://github.com/apache/incubator-mxnet/pull/14403#discussion_r265715731
##########
File path: tests/python/unittest/test_operator.py
##########
@@ -6606,6 +6606,31 @@ def test_slice_forward_backward(a, index):
for index in index_list:
test_slice_forward_backward(arr, index)
+ def test_begin_equals_end():
+ shape = (2, 4)
+ begin = (None, 2)
+ end = (None, 2)
+ step = (1, -1)
+ in_arr = mx.nd.arange(np.prod(shape)).reshape(shape=shape)
+ out_arr = mx.nd.slice(in_arr, begin=begin, end=end, step=step)
+
+ assertRaises(MXNetError, test_begin_equals_end)
+
+ # check for end=-1 and negative step
Review comment:
Can you also test end < -1 as in the branch on line https://github.com/apache/incubator-mxnet/pull/14403/files#diff-d5c9c7d539907caef01a08a74e16592bR689
----------------------------------------------------------------
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