summaryrefslogtreecommitdiff
path: root/mlir
diff options
context:
space:
mode:
Diffstat (limited to 'mlir')
-rw-r--r--mlir/lib/Dialect/Shape/IR/Shape.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/mlir/lib/Dialect/Shape/IR/Shape.cpp b/mlir/lib/Dialect/Shape/IR/Shape.cpp
index 24302544ea06..58d0e6aa3964 100644
--- a/mlir/lib/Dialect/Shape/IR/Shape.cpp
+++ b/mlir/lib/Dialect/Shape/IR/Shape.cpp
@@ -921,7 +921,13 @@ LogicalResult mlir::shape::ConstShapeOp::inferReturnTypes(
SmallVectorImpl<Type> &inferredReturnTypes) {
Builder b(context);
Properties *prop = properties.as<Properties *>();
- DenseIntElementsAttr shape = prop->shape;
+ DenseIntElementsAttr shape;
+ // TODO: this is only exercised by the Python bindings codepath which does not
+ // support properties
+ if (prop)
+ shape = prop->shape;
+ else
+ shape = attributes.getAs<DenseIntElementsAttr>("shape");
if (!shape)
return emitOptionalError(location, "missing shape attribute");
inferredReturnTypes.assign({RankedTensorType::get(