File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
mlir/lib/Dialect/Shape/IR Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -918,14 +918,12 @@ LogicalResult mlir::shape::ConstShapeOp::inferReturnTypes(
918
918
MLIRContext *context, std::optional<Location> location,
919
919
ConstShapeOp::Adaptor adaptor, SmallVectorImpl<Type> &inferredReturnTypes) {
920
920
Builder b (context);
921
- const Properties * prop = & adaptor.getProperties ();
921
+ const Properties prop = adaptor.getProperties ();
922
922
DenseIntElementsAttr shape;
923
923
// TODO: this is only exercised by the Python bindings codepath which does not
924
924
// support properties
925
- if (prop)
926
- shape = prop->shape ;
927
- else
928
- shape = adaptor.getAttributes ().getAs <DenseIntElementsAttr>(" shape" );
925
+ shape = prop.shape ? prop.shape :
926
+ adaptor.getAttributes ().getAs <DenseIntElementsAttr>(" shape" );
929
927
if (!shape)
930
928
return emitOptionalError (location, " missing shape attribute" );
931
929
inferredReturnTypes.assign ({RankedTensorType::get (
You can’t perform that action at this time.
0 commit comments