rondogency commented on a change in pull request #15921: [WIP] dynamic custom
operator support
URL: https://github.com/apache/incubator-mxnet/pull/15921#discussion_r318215889
##########
File path: src/c_api/c_api.cc
##########
@@ -284,6 +287,36 @@ int MXLoadLib(const char *path) {
return true;
};
+ // lambda function to call infer type
+ auto infer_type = [=] (const nnvm::NodeAttrs& attrs,
+ std::vector<int> *in_type,
+ std::vector<int> *out_type) {
+ // convert attributes to vector of char*
+ std::vector<const char*> attr_keys, attr_vals;
+ for (auto kv : attrs.dict) {
+ attr_keys.push_back(kv.first.c_str());
+ attr_vals.push_back(kv.second.c_str());
+ }
+
+ // copy input types from in_type
+ std::vector<int> intypes(*in_type);
Review comment:
I think we want to make sure the library author won't modify the input, so
passing a copy is a better approach
----------------------------------------------------------------
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