[mlir] Add InferTensorType without supporting reifyReturnTypeShapes

This is useful for the case that we don't need to implement
reifyReturnTypeShapes.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D121403
This commit is contained in:
Chia-hung Duan 2022-03-25 18:09:53 +00:00
parent f80aaa675f
commit dda003afa6
1 changed files with 4 additions and 3 deletions

View File

@ -135,7 +135,7 @@ def InferShapedTypeOpInterface : OpInterface<"InferShapedTypeOpInterface"> {
// Convenience class grouping together type and shaped type op interfaces for
// ops that have tensor return types.
class InferTensorType<list<string> overridenMethods = []> : TraitList<
class InferTensorTypeBase<list<string> overridenMethods = []> : TraitList<
[
// Op implements infer type op interface.
InferTypeOpInterface,
@ -146,9 +146,10 @@ class InferTensorType<list<string> overridenMethods = []> : TraitList<
// along with knowledge that it is producing Tensors to infer the type.
NativeOpTrait<"InferTensorType">
]>;
def InferTensorTypeWithReify: TraitList<InferTensorType<[
"inferReturnTypeComponents", "reifyReturnTypeShapes"]>.traits>;
def InferTensorType : InferTensorTypeBase<["inferReturnTypeComponents"]>;
def InferTensorTypeWithReify: InferTensorTypeBase<[
"inferReturnTypeComponents", "reifyReturnTypeShapes"]>;
def ReifyRankedShapedTypeOpInterface :
OpInterface<"ReifyRankedShapedTypeOpInterface"> {