conv bug fix (#154)

This commit is contained in:
Alexandre Eichenberger 2020-05-27 19:34:58 -04:00 committed by GitHub
parent 2b6befce87
commit 20dd6544aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ struct ONNXConvOpLowering : public ConversionPattern {
biasIndices.emplace_back(kernel); biasIndices.emplace_back(kernel);
auto loadBias = rewriter.create<LoadOp>(loc, biasOperand, kernel); auto loadBias = rewriter.create<LoadOp>(loc, biasOperand, kernel);
auto resultWithBias = auto resultWithBias =
rewriter.create<MulFOp>(loc, loadResult, loadBias); rewriter.create<AddFOp>(loc, loadResult, loadBias);
// Store initializer value into output location. // Store initializer value into output location.
rewriter.create<StoreOp>(loc, resultWithBias, alloc, resultIndices); rewriter.create<StoreOp>(loc, resultWithBias, alloc, resultIndices);
} }

View File

@ -1395,7 +1395,7 @@ func @test_conv_bias_no_pad(%arg0 : tensor<1x2x32x64xf32>, %arg1 : tensor<5x2x6x
// CHECK: } // CHECK: }
// CHECK: [[BIAS1:%.+]] = load [[RES]][%arg3, %arg4, %arg5, %arg6] : memref<1x5x27x58xf32> // CHECK: [[BIAS1:%.+]] = load [[RES]][%arg3, %arg4, %arg5, %arg6] : memref<1x5x27x58xf32>
// CHECK: [[BIAS2:%.+]] = load %arg2[%arg4] : memref<5xf32> // CHECK: [[BIAS2:%.+]] = load %arg2[%arg4] : memref<5xf32>
// CHECK: [[BIAS3:%.+]] = mulf [[BIAS1]], [[BIAS2]] : f32 // CHECK: [[BIAS3:%.+]] = addf [[BIAS1]], [[BIAS2]] : f32
// CHECK: store [[BIAS3]], [[RES]][%arg3, %arg4, %arg5, %arg6] : memref<1x5x27x58xf32> // CHECK: store [[BIAS3]], [[RES]][%arg3, %arg4, %arg5, %arg6] : memref<1x5x27x58xf32>
// CHECK: } // CHECK: }
// CHECK: } // CHECK: }