reminisce commented on a change in pull request #14409: [Numpy] Change 
semantics of ndim for operators in `src/operator/contrib`
URL: https://github.com/apache/incubator-mxnet/pull/14409#discussion_r265664351
 
 

 ##########
 File path: src/operator/contrib/adaptive_avg_pooling-inl.h
 ##########
 @@ -125,10 +125,13 @@ static bool AdaptiveAvgPoolOpInferShape(const 
nnvm::NodeAttrs& attrs,
   CHECK_EQ(out_shape->size(), 1U) << "Output:[data]";
   const AdaptiveAvgPoolParam& param = 
nnvm::get<AdaptiveAvgPoolParam>(attrs.parsed);
   mxnet::TShape dshape(in_shape->at(0));
-  if (dshape.ndim() == 0) return false;
-  if (param.output_size.ndim() == 0) {
+  if (mxnet::op::shape_is_none(dshape)) return false;
+  if (mxnet::op::shape_is_none(param.output_size)) {
 
 Review comment:
   Applying the semantics of unknown shape to tuple inputs is unclear. How 
about changing `output_size` from `TShape` to `Tuple<int>` or set default value 
for `output_size` as `TShape(0)` (same as an empty tuple) and keep everything 
unchanged here.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to