forked from OSchip/llvm-project
[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:
parent
1aa4f0bb6c
commit
35bd41916b
|
@ -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()));
|
||||
|
|
Loading…
Reference in New Issue