Skip to content

Commit

Permalink
Fix build issue on MSVC by not having a conditional on disjoint types.
Browse files Browse the repository at this point in the history
  • Loading branch information
stellaraccident committed Sep 7, 2023
1 parent 67ae97f commit a8fd275
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Conversion/TorchToTMTensor/TorchToTMTensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1273,13 +1273,13 @@ class ConvertAtenScatterReduceTwoOp
// 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);
}

Expand Down Expand Up @@ -1551,10 +1551,10 @@ class ConvertAtenCumsumOp : public OpConversionPattern<AtenCumsumOp> {
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);
});

Expand Down

0 comments on commit a8fd275

Please sign in to comment.