Fix build issue on MSVC by not having a conditional on disjoint types.

pull/2444/head snapshot-20230907.954
Stella Laurenzo 2023-09-06 20:03:53 -07:00
parent 67ae97f368
commit a8fd275a00
1 changed files with 6 additions and 6 deletions

View File

@ -1273,13 +1273,13 @@ public:
// Set the values in the input tensor to the smallest element of that
// type
TypedAttr minAttr = getNumericLimit(rewriter, srcType.getElementType(),
/*getMin=*/true);
/*getMin=*/true);
normalizationValue = rewriter.create<arith::ConstantOp>(loc, minAttr);
} else if (reduceEnum == torch_upstream::ReductionType::MIN) {
// Set the values in the input tensor to the largest element of that
// type
TypedAttr maxAttr = getNumericLimit(rewriter, srcType.getElementType(),
/*getMin=*/false);
/*getMin=*/false);
normalizationValue = rewriter.create<arith::ConstantOp>(loc, maxAttr);
}
@ -1551,10 +1551,10 @@ public:
Value result = createTMTensorScanOp(
rewriter, loc, input, output, acc, dim, /*inclusive=*/true,
[](OpBuilder &b, Location loc, Value input, Value acc) {
Value sum = (input.getType().isa<mlir::FloatType>()
? b.create<arith::AddFOp>(loc, input, acc)
: b.create<arith::AddIOp>(loc, input, acc))
->getResult(0);
Value sum =
(input.getType().isa<mlir::FloatType>()
? b.create<arith::AddFOp>(loc, input, acc)->getResult(0)
: b.create<arith::AddIOp>(loc, input, acc)->getResult(0));
b.create<TMTensor::YieldOp>(loc, sum);
});