Improve error message when constructing a Tensor with an invalid element type (NFC)

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D86040
This commit is contained in:
Mehdi Amini 2020-08-17 20:39:43 +00:00
parent 516328860c
commit 45cc86b09b

View file

@ -300,7 +300,7 @@ ArrayRef<int64_t> VectorType::getShape() const { return getImpl()->getShape(); }
static LogicalResult checkTensorElementType(Location location,
Type elementType) {
if (!TensorType::isValidElementType(elementType))
return emitError(location, "invalid tensor element type");
return emitError(location, "invalid tensor element type: ") << elementType;
return success();
}