File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Conversion/TorchOnnxToTorch Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2346,7 +2346,7 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(
2346
2346
ArrayRef<int64_t > inputShape = inputTensorType.getSizes ();
2347
2347
unsigned inputRank = inputShape.size ();
2348
2348
// only handle 2D, 3D and 5D pooling cases
2349
- if (inputRank > 5 or inputRank < 3 ) {
2349
+ if (inputRank > 5 || inputRank < 3 ) {
2350
2350
return failure ();
2351
2351
}
2352
2352
if (!resultType || !resultType.hasSizes ()) {
@@ -2454,7 +2454,7 @@ void mlir::torch::onnx_c::populateDefaultDomainGtoP(
2454
2454
" Unimplemented: unranked tensor" );
2455
2455
unsigned rank = *maybeRank;
2456
2456
// only 1D, 2D and 3D LpPool is supported.
2457
- if (rank > 5 or rank < 3 ) {
2457
+ if (rank > 5 || rank < 3 ) {
2458
2458
return failure ();
2459
2459
}
2460
2460
Original file line number Diff line number Diff line change @@ -9780,16 +9780,16 @@ class DecomposeAtenNllLossForwardOp
9780
9780
auto targetSizes = targetType.getSizes();
9781
9781
int64_t selfRank = selfSizes.size();
9782
9782
int64_t targetRank = targetSizes.size();
9783
- if (selfRank <= 0 or selfRank > 2) {
9783
+ if (selfRank <= 0 || selfRank > 2) {
9784
9784
return rewriter.notifyMatchFailure(op, "input tensor should be 1D or 2D");
9785
9785
}
9786
9786
if (targetRank > 1) {
9787
9787
return rewriter.notifyMatchFailure(op,
9788
9788
"target tensor shoule be 0D or 1D!");
9789
9789
}
9790
9790
9791
- if (selfRank != 1 or targetRank != 0) {
9792
- if (!(selfSizes[0] == kUnknownSize and targetSizes[0] == kUnknownSize) and
9791
+ if (selfRank != 1 || targetRank != 0) {
9792
+ if (!(selfSizes[0] == kUnknownSize && targetSizes[0] == kUnknownSize) &&
9793
9793
selfSizes[0] != targetSizes[0]) {
9794
9794
return rewriter.notifyMatchFailure(
9795
9795
op,
@@ -9907,7 +9907,7 @@ class DecomposeAtenNllLossForwardOp
9907
9907
zeroTensor);
9908
9908
9909
9909
Value totalWeight;
9910
- if (reduction == 0 and selfRank > 1) {
9910
+ if (reduction == 0 && selfRank > 1) {
9911
9911
auto zeroFloat =
9912
9912
rewriter.create<ConstantFloatOp>(loc, rewriter.getF64FloatAttr(0.0));
9913
9913
Value twSize = rewriter.create<PrimListConstructOp>(
You can’t perform that action at this time.
0 commit comments