Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[MXNET-860] Remove std::moves that have no affect (#12730)
Browse files Browse the repository at this point in the history
* [MXNET-860] Remove std::moves that have no affect

* [MXNET-860] Check for unneeded moves as errors
  • Loading branch information
KellenSunderland authored and marcoabreu committed Oct 4, 2018
1 parent 811618a commit ebe6ea8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Checks: >
# In order to trigger an error, you must have a rule defined both in checks and in this section.
WarningsAsErrors: >
cppcoreguidelines-no-malloc, modernize-use-nullptr, performance-unnecessary-copy-initialization,
modernize-use-emplace
modernize-use-emplace, performance-move-const-arg
# Todo: define a better regex match that includes most project headers, but excludes third party
# code.
Expand Down
6 changes: 3 additions & 3 deletions src/executor/infer_graph_attr_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ nnvm::Graph InferShape(nnvm::Graph&& graph,
graph.attrs["shape_inputs"] = std::make_shared<any>(std::move(shape_inputs));
}
if (shape_attr_key.length() != 0) {
graph.attrs["shape_attr_key"] = std::make_shared<any>(std::move(shape_attr_key));
graph.attrs["shape_attr_key"] = std::make_shared<any>(shape_attr_key);
}
return InferAttr<nnvm::TShape, nnvm::FInferShape>(
std::move(graph), nnvm::TShape(),
Expand All @@ -348,7 +348,7 @@ nnvm::Graph InferType(nnvm::Graph&& graph,
graph.attrs["dtype_inputs"] = std::make_shared<any>(std::move(dtype_inputs));
}
if (dtype_attr_key.length() != 0) {
graph.attrs["dtype_attr_key"] = std::make_shared<any>(std::move(dtype_attr_key));
graph.attrs["dtype_attr_key"] = std::make_shared<any>(dtype_attr_key);
}
return InferAttr<int, nnvm::FInferType>(
std::move(graph), -1,
Expand All @@ -366,7 +366,7 @@ nnvm::Graph InferStorageType(nnvm::Graph&& graph,
graph.attrs["storage_type_inputs"] = std::make_shared<any>(std::move(storage_type_inputs));
}
if (storage_type_attr_key.length() != 0) {
graph.attrs["storage_type_attr_key"] = std::make_shared<any>(std::move(storage_type_attr_key));
graph.attrs["storage_type_attr_key"] = std::make_shared<any>(storage_type_attr_key);
}
// initialize unknown values for dispatch modes
if (graph.attrs.count("dispatch_mode") == 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/operator/tensor/elemwise_unary_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ class OpBase {
in_blobs.reserve(inputs.size());
out_blobs.reserve(outputs.size());
for (size_t i = 0, n = inputs.size(); i < n; ++i) {
in_blobs.emplace_back(std::move(inputs[i].data()));
in_blobs.emplace_back(inputs[i].data());
}
for (size_t i = 0, n = outputs.size(); i < n; ++i) {
out_blobs.emplace_back(std::move(outputs[i].data()));
out_blobs.emplace_back(outputs[i].data());
}
computer(attrs, ctx, in_blobs, req, out_blobs);
}
Expand Down

0 comments on commit ebe6ea8

Please sign in to comment.