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_r265664996
##########
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)) {
dshape[2] = 1;
dshape[3] = 1;
+ } else if (param.output_size.ndim() == 0) {
Review comment:
It should be `ndim() == 1` 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