30 DestinationStyleOpInterface dstStyleOp =
31 cast<DestinationStyleOpInterface>(op);
34 for (
OpOperand &operand : dstStyleOp.getDpsInitsMutable()) {
35 Type type = operand.get().getType();
36 if (isa<TensorType>(type)) {
37 outputTensorOperands.push_back(&operand);
38 }
else if (!isa<BaseMemRefType>(type)) {
40 << operand.getOperandNumber() <<
" is a tensor or a memref";
45 if (getNumTensorResults(op) != outputTensorOperands.size())
46 return op->
emitOpError(
"expected the number of tensor results (")
47 << getNumTensorResults(op)
48 <<
") to be equal to the number of output tensors ("
49 << outputTensorOperands.size() <<
")";
51 for (
OpOperand *opOperand : outputTensorOperands) {
53 if (
result.getType() != opOperand->get().getType())
54 return op->
emitOpError(
"expected type of operand #")
55 << opOperand->getOperandNumber() <<
" ("
56 << opOperand->get().getType() <<
")"
57 <<
" to match type of corresponding result (" <<
result.getType()