KellenSunderland commented on a change in pull request #13311: [MXNET-703]
Minor refactor of TensorRT code
URL: https://github.com/apache/incubator-mxnet/pull/13311#discussion_r247355148
##########
File path: src/executor/trt_graph_executor.cc
##########
@@ -434,7 +435,7 @@ Executor *TrtGraphExecutor::TensorRTBind(nnvm::Symbol
symbol,
std::unordered_map<std::string,
NDArray> *shared_buffer,
Executor *shared_exec) {
auto exec = new exec::TrtGraphExecutor();
- exec->Init(symbol, default_ctx, group2ctx,
+ exec->Init(std::move(symbol), default_ctx, group2ctx,
Review comment:
It's a good question I wanted to dive into a little. My understanding is
that the Init function can bind its variable to either an lvalue or an rvalue
when passing by value. You don't have to create an overload or anything to
determine which one it expects. Here's an example:
https://gist.github.com/KellenSunderland/d431119580a116410c672b9535d85170
Which is using code borrowed from:
https://www.chromium.org/rvalue-references?tmpl=%2Fsystem%2Fapp%2Ftemplates%2Fprint%2F&showPrintDialog=1
----------------------------------------------------------------
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