Modernize emplace (#61742)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/61742

Test Plan: Sandcastle

Reviewed By: malfet

Differential Revision: D29717433

fbshipit-source-id: 93996388780862e90ab4e697508407091e8e763b
This commit is contained in:
Richard Barnes 2021-07-20 13:29:52 -07:00 committed by Facebook GitHub Bot
parent 2c2a084012
commit f78142b68d
2 changed files with 3 additions and 6 deletions

View File

@ -154,8 +154,7 @@ class ExprEval {
Stmt* store_stmt =
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
new Store(ret_buf.data(), indices, expr.node());
// NOLINTNEXTLINE(modernize-use-emplace)
buffer_args_extended.push_back(ret_buf);
buffer_args_extended.emplace_back(ret_buf);
codegen_.reset(new CodeGenType(store_stmt, buffer_args_extended));
}
@ -198,8 +197,7 @@ class ExprEval {
case ScalarType::Bool: {
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
std::vector<unsigned char> ret_val_arg(1);
// NOLINTNEXTLINE(modernize-use-emplace)
call_args_extended.push_back(CallArg(ret_val_arg.data()));
call_args_extended.emplace_back(ret_val_arg.data());
codegen_->call(call_args_extended);
ret_value_ = Value((bool)ret_val_arg[0]);
} break;

View File

@ -117,8 +117,7 @@ Tensor* computeMean(
// When dims argument is not specified, reduce over all dimensions
// NOLINTNEXTLINE(clang-diagnostic-sign-compare)
for (int64_t idx = 0; idx < InputBuf.ndim(); idx++) {
// NOLINTNEXTLINE(modernize-use-emplace)
mean_dims_expr.push_back(idx);
mean_dims_expr.emplace_back(idx);
}
}
return new Tensor(