Could this be simplified to something like:

int idx = 0;
for(int i=0; i<ndim; i++) {
   if(i != axis1 && i != axis2)
      oshape[idx++] = ishape[i]
oshape[ndim-2] = s;

Also, the final dimension assignment on line 104 looks wrong. Shouldnt it be 
oshape[n_dim - 2] = s;? Since the output tensor will be 1 dimension smaller 
than the input tensor (and off-by-1 for 0-based versus ndim being the count).

[ Full content available at: 
https://github.com/apache/incubator-mxnet/pull/12430 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to