ptrendx commented on a change in pull request #14728: [MXNET-1386] fix for 
shape mismatch
URL: https://github.com/apache/incubator-mxnet/pull/14728#discussion_r297424265
 
 

 ##########
 File path: src/executor/graph_executor.cc
 ##########
 @@ -558,20 +558,31 @@ void GraphExecutor::InitArguments(const 
nnvm::IndexedGraph& idx,
                                   const std::unordered_set<std::string>& 
shared_arg_names,
                                   const Executor* shared_exec,
                                   std::unordered_map<std::string, NDArray>* 
shared_buffer,
+                                  std::vector<std::string>* in_names,
                                   std::vector<NDArray>* in_arg_vec,
                                   std::vector<NDArray>* arg_grad_vec,
                                   std::vector<NDArray>* aux_state_vec) {
+  // build name/index map for graph input nodes
+  std::map<std::string, uint32_t> inv_name_map;
+  for (size_t i = 0; i < num_forward_inputs_; ++i) {
+    const uint32_t nid = idx.input_nodes().at(i);
+    const std::string& arg_name = idx[nid].source->attrs.name;
+    inv_name_map[arg_name] = nid;
 
 Review comment:
   Currently MXNet allows you to pass multiple inputs with the same name 
(although it does not really make sense). This will break here - a check should 
be introduced to give a meaningful error message in this case.

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