eric-haibin-lin commented on a change in pull request #14153: Fix shape 
inference pass
URL: https://github.com/apache/incubator-mxnet/pull/14153#discussion_r257115789
 
 

 ##########
 File path: src/executor/infer_graph_attr_pass.cc
 ##########
 @@ -282,26 +285,28 @@ nnvm::Graph InferAttr(nnvm::Graph &&ret,
   };
 
   size_t last_num_unknown;
-  size_t num_unknown_dispatch_mode = dispatch_mode_name ? node_end - 
node_start : 0;
-  size_t num_unknown_entry_attr = entry_end - entry_start;
-  size_t num_unknown = num_unknown_entry_attr + num_unknown_dispatch_mode;
+  size_t num_unknown = static_cast<size_t>(-1);  // Infinity
+
+  if (scalars_only) {
+    size_t num_unknown_dispatch_mode = dispatch_mode_name ? node_end - 
node_start : 0;
+    size_t num_unknown_entry_attr = entry_end - entry_start;
+    num_unknown = num_unknown_entry_attr + num_unknown_dispatch_mode;
+  }
   int i = 0;
   do {
-    if (i % 2 == 0) {
 
 Review comment:
   If the forward pass doesn't infer anything, then the backward pass won't 
either. I think the original code is fine

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