mirror of
https://github.com/intel/llvm.git
synced 2026-01-24 08:30:34 +08:00
[ODS] Quick fix
Quick fix for a failing test in https://reviews.llvm.org/rG5267ed05bc4612e91409d63b4dbc4e01751acb75 Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D155637
This commit is contained in:
@@ -918,14 +918,12 @@ LogicalResult mlir::shape::ConstShapeOp::inferReturnTypes(
|
||||
MLIRContext *context, std::optional<Location> location,
|
||||
ConstShapeOp::Adaptor adaptor, SmallVectorImpl<Type> &inferredReturnTypes) {
|
||||
Builder b(context);
|
||||
const Properties *prop = &adaptor.getProperties();
|
||||
const Properties prop = adaptor.getProperties();
|
||||
DenseIntElementsAttr shape;
|
||||
// TODO: this is only exercised by the Python bindings codepath which does not
|
||||
// support properties
|
||||
if (prop)
|
||||
shape = prop->shape;
|
||||
else
|
||||
shape = adaptor.getAttributes().getAs<DenseIntElementsAttr>("shape");
|
||||
shape = prop.shape ? prop.shape :
|
||||
adaptor.getAttributes().getAs<DenseIntElementsAttr>("shape");
|
||||
if (!shape)
|
||||
return emitOptionalError(location, "missing shape attribute");
|
||||
inferredReturnTypes.assign({RankedTensorType::get(
|
||||
|
||||
Reference in New Issue
Block a user