[NFC] Specify "reifyReturnTypeShapes" in DeclareOpInterfaceMethod overridenMethods

- This causes declaration of reifyReturnTypeShapes to be inserted in the TableGen
  generated code without explicitly adding it in extraClassDeclaration.

PiperOrigin-RevId: 333315601
This commit is contained in:
Rahul Joshi 2020-09-23 10:07:39 -07:00 committed by TensorFlow MLIR Team
parent 87d9e6951e
commit 3ca740103d
1 changed files with 2 additions and 8 deletions

View File

@ -79,7 +79,8 @@ class HLOClient_BroadcastBinaryElementwiseOp<
string mnemonic, list<OpTrait> traits> : string mnemonic, list<OpTrait> traits> :
HLOClient_Op<mnemonic, HLOClient_Op<mnemonic,
!listconcat(traits, [ !listconcat(traits, [
DeclareOpInterfaceMethods<InferShapedTypeOpInterface>])> { DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
["reifyReturnTypeShapes"]>])> {
let arguments = (ins let arguments = (ins
HLO_Tensor:$lhs, HLO_Tensor:$lhs,
HLO_Tensor:$rhs, HLO_Tensor:$rhs,
@ -99,13 +100,6 @@ class HLOClient_BroadcastBinaryElementwiseOp<
$lhs `,` $rhs attr-dict `:` $lhs `,` $rhs attr-dict `:`
`(` type($lhs) `,` type($rhs) `)` `->` type(results) `(` type($lhs) `,` type($rhs) `)` `->` type(results)
}]; }];
let extraClassDeclaration = [{
// TODO(laurenzo): It isn't clear to me why reifyReturnShapes does not
// have its declaration generated by DeclareOpInterfaceMethods.
LogicalResult reifyReturnTypeShapes(
OpBuilder& builder, SmallVectorImpl<Value>& reifiedReturnShapes);
}];
} }
def HLOClient_BroadcastAddOp : HLOClient_BroadcastBinaryElementwiseOp<"broadcast_add", def HLOClient_BroadcastAddOp : HLOClient_BroadcastBinaryElementwiseOp<"broadcast_add",