Skip to content

Commit

Permalink
Fix getConstant: swap int and real parts
Browse files Browse the repository at this point in the history
  • Loading branch information
slyalin committed Jul 15, 2024
1 parent a72084c commit 119e43a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ mlir::arith::ConstantOp getConstant(OpBuilder &builder, const ov::element::Type&
auto unkLoc = builder.getUnknownLoc();
TypedAttr attr;
auto type = importPrecision(builder.getContext(), precision);
if(precision.is_real()) {
if(precision.is_integral()) {
attr = builder.getIntegerAttr(type, int64_t(value));
} else if(precision.is_integral()) {
} else if(precision.is_real()) {
attr = builder.getFloatAttr(type, double(value));
}
assert(attr && "Unsupported ConstantOp type");
Expand Down

0 comments on commit 119e43a

Please sign in to comment.