samskalicky commented on a change in pull request #17270: [WIP] Dynamic custom operator GPU support URL: https://github.com/apache/incubator-mxnet/pull/17270#discussion_r367700150
########## File path: include/mxnet/lib_api.h ########## @@ -982,17 +1045,22 @@ extern "C" { // create a vector of tensors for inputs std::vector<MXTensor> inputs(num_in); for (int i = 0; i < num_in; i++) { - inputs[i].setTensor(indata[i], (MXDType)intypes[i], inshapes[i], indims[i], inIDs[i]); + std::string ctx_str(indev_type[i]); + MXContext inctx = {ctx_str, indev_id[i]}; + inputs[i].setTensor(indata[i], (MXDType)intypes[i], inshapes[i], indims[i], Review comment: string can be initialized with char* http://www.cplusplus.com/reference/string/string/string/ (see constructor 4) can we just inline everything and not create intermediary variables? ``` inputs[i].setTensor(indata[i], (MXDType)intypes[i], inshapes[i], indims[i], inIDs[i], {ctx_str, indev_id[i]}); ``` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services