eric-haibin-lin commented on a change in pull request #7947: [WIP] Refactor 
infer storage function for sparse operators.
URL: https://github.com/apache/incubator-mxnet/pull/7947#discussion_r140920921
 
 

 ##########
 File path: src/executor/graph_executor.cc
 ##########
 @@ -538,24 +538,31 @@ void GraphExecutor::Init(nnvm::Symbol symbol,
       data_entry_[eid] = aux_states[aux_top];
       arg_shapes.push_back(aux_states[aux_top].shape());
       arg_dtypes.push_back(aux_states[aux_top].dtype());
-      arg_stypes.push_back(aux_states[aux_top].storage_type());
+      arg_stypes[eid] = aux_states[aux_top].storage_type();
       aux_state_map_.emplace(arg_name, aux_states[aux_top]);
       ++aux_top;
     } else {
       CHECK_LT(arg_top, in_args.size());
       data_entry_[eid] = in_args[arg_top];
       arg_shapes.push_back(in_args[arg_top].shape());
       arg_dtypes.push_back(in_args[arg_top].dtype());
-      arg_stypes.push_back(in_args[arg_top].storage_type());
+      arg_stypes[eid] = in_args[arg_top].storage_type();
       in_arg_map_.emplace(arg_name, in_args[arg_top]);
       if (kNullOp != grad_req_types[arg_top]) {
+        auto grad_oid = grad_store_.size() + num_forward_outputs_;
+        auto grad_eid = idx.entry_id(idx.outputs()[grad_oid]);
+        arg_stypes[grad_eid] = arg_grad_store[arg_top].storage_type();
         grad_store_.emplace_back(grad_req_types[arg_top], 
arg_grad_store[arg_top]);
         arg_grad_map_.emplace(arg_name, arg_grad_store[arg_top]);
+        if (log_verbose_) {
 
 Review comment:
   ??
   This is to enable inferstorage with provided out_grad stypes
 
----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to