@@ -1058,7 +1058,10 @@ computeExpandedPadding(tensor::PadOp padOp, ArrayRef<int64_t> expandedShape,
10581058 PatternRewriter &rewriter) {
10591059 // If the padding value depends on the index values of the pad operation,
10601060 // then it may not be valid to expand the dimensions, since it will change
1061- // the index values on which the padding value depends.
1061+ // the index values on which the padding value depends. This is not currently
1062+ // supported by the pad expansion patterns, but it could be implemented
1063+ // similarly to the expansion of linalg.generic ops with linalg.index ops in
1064+ // the body, as is done in `updateExpandedGenericOpRegion`.
10621065 if (!padOp.getConstantPaddingValue ())
10631066 return failure ();
10641067
@@ -2034,7 +2037,10 @@ computeCollapsedPadding(tensor::PadOp padOp,
20342037 PatternRewriter &rewriter) {
20352038 // If the padding value depends on the index values of the pad operation,
20362039 // then it may not be valid to collapse the dimensions, since it will change
2037- // the index values on which the padding value depends.
2040+ // the index values on which the padding value depends. This is not currently
2041+ // supported by the pad expansion patterns, but it could be implemented
2042+ // similarly to the collapsing of linalg.generic ops with linalg.index ops in
2043+ // the body, as is done in `generateCollapsedIndexingRegion`.
20382044 if (!padOp.getConstantPaddingValue ())
20392045 return failure ();
20402046
0 commit comments