[Mlir-commits] [mlir] 45cc86b - Improve error message when constructing a Tensor with an invalid element type (NFC)
Mehdi Amini
llvmlistbot at llvm.org
Mon Aug 17 13:40:42 PDT 2020
Author: Mehdi Amini
Date: 2020-08-17T20:40:32Z
New Revision: 45cc86b09bcd499c9d26b83e70114f0be8ecfa85
URL: https://github.com/llvm/llvm-project/commit/45cc86b09bcd499c9d26b83e70114f0be8ecfa85
DIFF: https://github.com/llvm/llvm-project/commit/45cc86b09bcd499c9d26b83e70114f0be8ecfa85.diff
LOG: Improve error message when constructing a Tensor with an invalid element type (NFC)
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D86040
Added:
Modified:
mlir/lib/IR/StandardTypes.cpp
Removed:
################################################################################
diff --git a/mlir/lib/IR/StandardTypes.cpp b/mlir/lib/IR/StandardTypes.cpp
index 9205a7da90007..f07532434a547 100644
--- a/mlir/lib/IR/StandardTypes.cpp
+++ b/mlir/lib/IR/StandardTypes.cpp
@@ -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();
}
More information about the Mlir-commits
mailing list