@@ -1293,6 +1293,12 @@ class ConvertAtenSqueezeOp : public OpConversionPattern<AtenOpT> {
1293
1293
auto newOutputTy = RankedTensorType::get (
1294
1294
makeShapeLLVMCompatible (newOutputShape), resultElemTy);
1295
1295
1296
+ if (newOutputTy.getNumDynamicDims () > 1 ) {
1297
+ return rewriter.notifyMatchFailure (
1298
+ op, " Squeeze op resulting in multiple dynamic dimensions in the "
1299
+ " output is not supported." );
1300
+ }
1301
+
1296
1302
auto reshapeOp = rewriter.create <tosa::ReshapeOp>(
1297
1303
op->getLoc (),
1298
1304
OpConversionPattern<AtenOpT>::getTypeConverter ()->convertType (
@@ -3230,6 +3236,12 @@ LogicalResult ConvertAtenOp<AtenUnsqueezeOp>::matchAndRewrite(
3230
3236
op, " Only tensor types are currently supported" );
3231
3237
}
3232
3238
3239
+ if (selfType.getNumDynamicDims () > 1 ) {
3240
+ return rewriter.notifyMatchFailure (
3241
+ op,
3242
+ " AtenUnsqueezeOp with multiple dynamic dimensions is not supported." );
3243
+ }
3244
+
3233
3245
auto selfRank = selfType.getRank ();
3234
3246
auto selfElemTy = selfType.getElementType ();
3235
3247
if (!selfElemTy.isIntOrFloat ()) {
@@ -3925,6 +3937,11 @@ class ConvertAtenMinMaxDimOp : public OpConversionPattern<AtenOpT> {
3925
3937
}
3926
3938
3927
3939
if (argMaxOp.getType () != indicesType) {
3940
+ if (indicesType.getNumDynamicDims () > 1 ) {
3941
+ return rewriter.notifyMatchFailure (
3942
+ op, " AtenMaxDimOp resulting in multiple dynamic dimensions in the "
3943
+ " output is not supported." );
3944
+ }
3928
3945
argMaxOp = rewriter.create <tosa::ReshapeOp>(
3929
3946
op->getLoc (), indicesType, argMaxOp,
3930
3947
tosa::getTosaConstShape (rewriter, op->getLoc (), reducedShape));
0 commit comments