[mlir] Add assert to fail with more info (NFC)

This would have assert before during tensor type construction with
opaque error, assert and fail earlier now.
This commit is contained in:
Jacques Pienaar 2022-04-14 19:54:12 -07:00
parent 1aa4f0bb6c
commit 35bd41916b
1 changed files with 2 additions and 0 deletions

View File

@ -191,6 +191,8 @@ LogicalResult mlir::detail::inferReturnTensorTypes(
return failure();
for (const auto &shapeAndType : retComponents) {
assert(shapeAndType.getAttribute() == nullptr && "attribute not supported");
assert(shapeAndType.getElementType() &&
"element type required to construct tensor");
if (shapeAndType.hasRank())
inferredReturnTypes.push_back(RankedTensorType::get(
shapeAndType.getDims(), shapeAndType.getElementType()));