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_r140919833
##########
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) {
+ if (v == -1) v = kDefaultStorage;
+ }
+ for (int& v : *iattr) {
Review comment:
same, int by reference?
----------------------------------------------------------------
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