[Mlir-commits] [mlir] [mlir][tensor] Add a tensor.concat operation (PR #72779)

Nicolas Vasilache llvmlistbot at llvm.org
Mon Nov 20 04:50:29 PST 2023


================
@@ -471,6 +471,202 @@ void CastOp::getCanonicalizationPatterns(RewritePatternSet &results,
   results.add<ChainedTensorCast, TensorCastExtractSlice>(context);
 }
 
+//===----------------------------------------------------------------------===//
+// ConcatOp
+//===----------------------------------------------------------------------===//
+
+FailureOr<RankedTensorType> ConcatOp::inferResultType(int64_t dim,
+                                                      TypeRange inputTypes) {
+  if (dim < 0)
+    return failure();
----------------
nicolasvasilache wrote:

It seems un some of these cases, you're trying a bit too hard to be nice and end up duplicating the verifier.
Maybe we can turn some of these failures into assertions (but being very careful that they cannot be hit from verifier because that is another can of worms..)

https://github.com/llvm/llvm-project/pull/72779


More information about the Mlir-commits mailing list