[Mlir-commits] [mlir] [MLIR] Preserve Encoding During TensorOp Creation (PR #80871)
ian Bearman
llvmlistbot at llvm.org
Thu Feb 8 07:46:29 PST 2024
================
@@ -1622,7 +1623,20 @@ CollapseShapeOp::inferCollapsedType(RankedTensorType type,
currentDim += dim;
}
- return RankedTensorType::get(newShape, type.getElementType());
+ auto encoding = type.getEncoding();
+ if (auto v = encoding.dyn_cast_or_null<VerifiableTensorEncoding>()) {
+ auto ignoreError = [&] {
+ auto emitter = mlir::emitError(UnknownLoc::get(type.getContext()));
+ emitter.abandon();
+ return emitter;
+ };
+ if (failed(
----------------
manbearian wrote:
@aartbik thank you for the reply.
You say "an error seems the right approach"
I want to be clear on two things:
1. The change i have now is *not* emitting an error; its falling-back to the pre-commit behavior of just dropping the attribute.
2. Changing the code to emit error in this case will break exiting code, including some tests.
Given this, are you okay with the code as is? Alternatively, i can emit an error here and make the failing tests as expected fail? I'm okay with either option.
https://github.com/llvm/llvm-project/pull/80871
More information about the Mlir-commits
mailing list