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_r265669339
 
 

 ##########
 File path: src/operator/contrib/dgl_graph.cc
 ##########
 @@ -263,10 +263,11 @@ static bool CSRNeighborUniformSampleShape(const 
nnvm::NodeAttrs& attrs,
   // We use the last element to store the actual
   // number of vertices in the subgraph.
   out_shape[0] = params.max_num_vertices + 1;
+  // TODO(@reminisce): is there anything like `size_is_none`, or using Size() 
is just fine?
   for (size_t i = 0; i < num_subgraphs; i++) {
     SHAPE_ASSIGN_CHECK(*out_attrs, i, out_shape);
     success = success &&
-              out_attrs->at(i).ndim() != 0U &&
+              !mxnet::op::shape_is_none(out_attrs->at(i)) &&
 
 Review comment:
   I think here the original `out_attrs->at(i).ndim() != 0U && 
out_attrs->at(i).Size() != 0U` should be just replaced with 
`!mxnet::op::shape_is_none(out_attrs->at(i))`

----------------------------------------------------------------
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