forked from OSchip/llvm-project
Implement IfOp verification
This would also make the CallOp and ExtractElementOp invocations from eliminateIfOp function always valid and removes the need for error handling. Also, verify TensorFlowOp trait. PiperOrigin-RevId: 221737192
This commit is contained in:
parent
8b6bc09f48
commit
2213afa784
|
@ -408,10 +408,16 @@ public:
|
|||
TensorType() = default;
|
||||
/* implicit */ TensorType(Type::ImplType *ptr);
|
||||
|
||||
/// Return true if the specified element type is a TensorFlow type that is ok
|
||||
/// in a tensor.
|
||||
static bool isValidTFElementType(Type type) {
|
||||
return type.isa<FloatType>() || type.isa<IntegerType>() ||
|
||||
type.isa<OtherType>();
|
||||
}
|
||||
|
||||
/// Return true if the specified element type is ok in a tensor.
|
||||
static bool isValidElementType(Type type) {
|
||||
return type.isa<FloatType>() || type.isa<VectorType>() ||
|
||||
type.isa<IntegerType>() || type.isa<OtherType>() ||
|
||||
return isValidTFElementType(type) || type.isa<VectorType>() ||
|
||||
type.isa<IndexType>();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue