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

 ##########
 File path: src/c_api/c_api_function.cc
 ##########
 @@ -107,6 +107,24 @@ void Backward(const OpStatePtr& state,
   Imperative::Get()->set_is_recording(prev_recording);
 }
 
+// infer storage function for custom op, which assigns kDefaultStorage for
+// all undefined stypes, and dispatch on kDispatchFComputeEx.
+inline bool CustomFunctionStorageType(const nnvm::NodeAttrs& attrs,
+                                      const int dev_mask,
+                                      int* dispatch_mode,
+                                      std::vector<int> *iattr,
+                                      std::vector<int> *oattr) {
+  for (int& v : *oattr) {
 
 Review comment:
   Why int by reference here?  This means indirect addressing when accessed 
which is slower than just holding the scalar value.
   ie:
   for example, indirect addressing:
     lea esi, [oattr + 4]  ; for example, second item
     mov eax, [esi]  ; eax now holds 
   
   as opposed to scalar immediate:
     mov eax, [oattr + 4]
   
 
----------------------------------------------------------------
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