Pull duplicated build() in subclasses into root UnaryOp

PiperOrigin-RevId: 221326369
This commit is contained in:
Lei Zhang 2018-11-13 13:45:47 -08:00 committed by jpienaar
parent 8659f3fa2c
commit 07b594de46
1 changed files with 7 additions and 0 deletions

View File

@ -162,4 +162,11 @@ class BinaryOp<string mnemonic, list<OpProperty> props> :
class UnaryOp<string mnemonic, list<OpProperty> props> :
Op<mnemonic, props>, Operands<[Tensor]>, Results<[Tensor]> {
let builder = [{
static void build(Builder *builder, OperationState *result,
SSAValue *arg) {
result->addOperands({arg});
result->types.push_back(arg->getType());
}
}];
}