Skip to content

Commit a365155

Browse files
committed
fix review comments
Change-Id: I3e575b6e24ca7136aee0029b6a6361b85d99fac3
1 parent 640d4c6 commit a365155

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/Conversion/TorchToTosa/TorchToTosa.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,15 +3007,13 @@ LogicalResult ConvertAtenOp<ValueTensorLiteralOp>::matchAndRewrite(
30073007
// keep TOSA constants signless and avoid downstream type mismatches.
30083008
auto shapedAttrTy = cast<ShapedType>(res.getType());
30093009
if (auto intTy = dyn_cast<IntegerType>(shapedAttrTy.getElementType())) {
3010-
auto signlessTy =
3011-
IntegerType::get(rewriter.getContext(), intTy.getWidth());
3012-
if (intTy != signlessTy) {
3010+
if (!intTy.isSignless()) {
3011+
auto signlessTy =
3012+
IntegerType::get(rewriter.getContext(), intTy.getWidth());
30133013
auto newTy = RankedTensorType::get(shapedAttrTy.getShape(), signlessTy);
30143014
attr = DenseResourceElementsAttr::get(newTy, res.getRawHandle());
30153015
}
30163016
}
3017-
rewriter.replaceOpWithNewOp<tosa::ConstOp>(op, outputTy, attr);
3018-
return success();
30193017
}
30203018
rewriter.replaceOpWithNewOp<tosa::ConstOp>(op, outputTy, attr);
30213019
return success();

0 commit comments

Comments
 (0)