File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
lib/Conversion/TorchToTosa Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments