Skip to content

Commit 523a247

Browse files
committed
Change name convention and handling error for match failure
1 parent 5a71e82 commit 523a247

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/Conversion/TorchToLinalg/Uncategorized.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2588,16 +2588,16 @@ class ConvertAtenGridSamplerOp : public OpConversionPattern<AtenGridSamplerOp> {
25882588
};
25892589

25902590
auto lambdaBorder = [&](OpBuilder &b, Location loc, Value x,
2591-
Value SizeSubOne) -> Value {
2591+
Value sizeSubOne) -> Value {
25922592
Value xMaxZero = b.create<arith::MaximumFOp>(loc, x, zeroFloat);
2593-
return b.create<arith::MinimumFOp>(loc, xMaxZero, SizeSubOne);
2593+
return b.create<arith::MinimumFOp>(loc, xMaxZero, sizeSubOne);
25942594
};
25952595

25962596
auto lambdaPadding = [&](OpBuilder &b, Location loc, int64_t paddingMode,
2597-
Value x, Value SizeSubOne) -> Value {
2597+
Value x, Value sizeSubOne) -> Value {
25982598
// Border
25992599
if (paddingMode == 1) {
2600-
return lambdaBorder(b, loc, x, SizeSubOne);
2600+
return lambdaBorder(b, loc, x, sizeSubOne);
26012601
}
26022602

26032603
return x;
@@ -2609,7 +2609,10 @@ class ConvertAtenGridSamplerOp : public OpConversionPattern<AtenGridSamplerOp> {
26092609
Value interMode = adaptor.getInterpolationMode();
26102610

26112611
int64_t paddingModeInt;
2612-
matchPattern(op.getPaddingMode(), m_TorchConstantInt(&paddingModeInt));
2612+
if(!matchPattern(op.getPaddingMode(), m_TorchConstantInt(&paddingModeInt))) {
2613+
return failure();
2614+
}
2615+
26132616

26142617
SmallVector<Value> dynamicSizes{};
26152618
if (resultType.isDynamicDim(0))

0 commit comments

Comments
 (0)