let arguments = (ins AnyTensor);
let results = (outs Index);
+ let verifier = ?;
let builders = [OpBuilder<
"Builder *builder, OperationState *result, Value *tensor", [{
parser->addTypeToList(indexType, result->types));
}
-static LogicalResult verify(RankOp op) {
- auto type = op.getOperand()->getType();
- if (!type.isa<TensorType>()) {
- return op.emitOpError("requires an operand that is a tensor");
- }
- return success();
-}
-
OpFoldResult RankOp::fold(ArrayRef<Attribute> operands) {
// Constant fold rank when the rank of the tensor is known.
auto type = getOperand()->getType();