reminisce commented on a change in pull request #11406: [MXNET-599] Partial
shape infer for Slice
URL: https://github.com/apache/incubator-mxnet/pull/11406#discussion_r200494778
##########
File path: tests/python/unittest/test_operator.py
##########
@@ -5740,6 +5740,30 @@ def test_slice_forward_backward(a, index):
slice_sym = mx.sym.slice(data, begin=[0, None], end=[1, None], step=[2,
-1])
check_numeric_gradient(slice_sym, [in_data])
+def test_slice_partial_infer():
+ var1 = mx.sym.var(name="data", shape=(0,20))
Review comment:
Can you modulize the test code? For example:
```python
def check_slice_partial_shape_infer(data, begin, end, step,
expected_out_shape):
out = mx.sym.slice(data, begin, end, step)
assert out.infer_shape_partial()[1][0] == expected_out_shape
check_slice_partial_shape_infer(var1, (None, None), (None, 10), None, (0,
10))
...
```
----------------------------------------------------------------
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