Skip to content

Commit

Permalink
polish details by reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chenwhql committed Feb 9, 2021
1 parent 0c90069 commit e24aba2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions paddle/fluid/extension/src/op_meta_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ namespace paddle {
////////////////////// Op Meta Info //////////////////////

OpMetaInfo& OpMetaInfo::Inputs(std::vector<std::string>&& inputs) {
inputs_ = inputs;
inputs_ = std::forward<std::vector<std::string>>(inputs);
return *this;
}
OpMetaInfo& OpMetaInfo::Outputs(std::vector<std::string>&& outputs) {
outputs_ = outputs;
outputs_ = std::forward<std::vector<std::string>>(outputs);
return *this;
}
OpMetaInfo& OpMetaInfo::SetKernelFn(KernelFunc&& func) {
kernel_fn_ = func;
kernel_fn_ = std::forward<KernelFunc>(func);
return *this;
}
OpMetaInfo& OpMetaInfo::SetInferShapeFn(InferShapeFunc&& func) {
infer_shape_fn_ = func;
infer_shape_fn_ = std::forward<InferShapeFunc>(func);
return *this;
}
OpMetaInfo& OpMetaInfo::SetInferDtypeFn(InferDtypeFunc&& func) {
infer_dtype_fn_ = func;
infer_dtype_fn_ = std::forward<InferDtypeFunc>(func);
return *this;
}

Expand All @@ -62,7 +62,7 @@ OpMetaInfoBuilder::OpMetaInfoBuilder(std::string&& name) {
name_ = std::forward<std::string>(name);
auto& info_vector = OpMetaInfoMap::Instance()[name_];
auto op_meta = OpMetaInfo(name_);
info_vector.emplace_back(op_meta);
info_vector.emplace_back(std::move(op_meta));
info_ptr_ = &(info_vector.back());
}

Expand Down Expand Up @@ -97,7 +97,7 @@ OpMetaInfoBuilder& OpMetaInfoBuilder::SetBackwardOp(
const std::string& bwd_op_name) {
auto& info_vector = OpMetaInfoMap::Instance()[name_];
auto op_meta = OpMetaInfo(bwd_op_name);
info_vector.emplace_back(op_meta);
info_vector.emplace_back(std::move(op_meta));
info_ptr_ = &(info_vector.back());
return *this;
}
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/custom_tensor_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

template <typename T>
paddle::Tensor InitCPUTensorForTest() {
std::vector<int> tensor_shape = {5, 5};
std::vector<int> tensor_shape{5, 5};
auto t1 = paddle::Tensor(paddle::PlaceType::kCPU);
t1.reshape(tensor_shape);
auto* p_data_ptr = t1.mutable_data<T>(paddle::PlaceType::kCPU);
Expand Down

0 comments on commit e24aba2

Please sign in to comment.