Use perfect forwarding for OpBuilder::create args (NFC)

This looks like an oversight, and it can be useful for building using
non-copyable types.

PiperOrigin-RevId: 260032944
This commit is contained in:
Mehdi Amini 2019-07-25 15:27:31 -07:00 committed by A. Unique TensorFlower
parent e63f628473
commit c69e436dce
1 changed files with 2 additions and 2 deletions

View File

@ -294,9 +294,9 @@ public:
/// Create an operation of specific op type at the current insertion point.
template <typename OpTy, typename... Args>
OpTy create(Location location, Args... args) {
OpTy create(Location location, Args&&... args) {
OperationState state(location, OpTy::getOperationName());
OpTy::build(this, &state, args...);
OpTy::build(this, &state, std::forward<Args>(args)...);
auto *op = createOperation(state);
auto result = dyn_cast<OpTy>(op);
assert(result && "Builder didn't return the right type");