szha commented on issue #14062: Bug in Hybridize w/ Concat
URL: 
https://github.com/apache/incubator-mxnet/issues/14062#issuecomment-461292694
 
 
   @stephenrawls after taking a close look at the code, I think the problem 
mainly comes from the call on 
[slice](https://mxnet.incubator.apache.org/versions/master/api/python/ndarray/ndarray.html#mxnet.ndarray.slice).
 Its doc says:
   
   >For an input array of shape=(d_0, d_1, ..., d_n-1), slice operation with 
begin=(b_0, b_1...b_m-1), end=(e_0, e_1, ..., e_m-1), and step=(s_0, s_1, ..., 
s_m-1), where m <= n, results in an array with the shape (|e_0-b_0|/|s_0|, ..., 
|e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1).
   
   Since in the code snippet, it has `begin=(0,0,0), end=(0,1,0)` without step, 
this means the output shape would be `(0,1,0)`. This is not supported and slice 
should throw an error on that.
   
   However, since the code did't check for it, NDArray actually returned result 
as in MXNet the dimension value 0 is used as a placeholder value for unknown 
size, which in symbolic mode (i.e. Gluon hybridized mode) would trigger further 
shape inference, which properly triggers the shape inference error.
   
   I haven't yet traced what happened in slice after getting 0 in size in the 
slice kernel, though that might need fix too.

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


With regards,
Apache Git Services

Reply via email to