diff --git a/backends/cadence/reference/operators/quantized_conv_out.cpp b/backends/cadence/reference/operators/quantized_conv_out.cpp index 95236b4397b..1a9e5fcd85f 100644 --- a/backends/cadence/reference/operators/quantized_conv_out.cpp +++ b/backends/cadence/reference/operators/quantized_conv_out.cpp @@ -18,6 +18,7 @@ namespace native { using Tensor = exec_aten::Tensor; using RuntimeContext = torch::executor::RuntimeContext; +using ScalarType = exec_aten::ScalarType; // This implements a generic 2d conv kernel that operates on raw pointers. // The version handles both quantized and fp32 convolutions. @@ -108,7 +109,8 @@ __attribute__((noinline)) void conv2d_nchw_core_generic( int woff = _wh * ww + _ww; float lhs = in_plane[ioff] - in_zero_point; float rhs = weight_plane[woff] - - (quantized ? weight_zero_point[0] : 0); + (quantized ? 0 : 0); + /*(quantized ? weight_zero_point[0] : 0);*/ acc += lhs * rhs; } } @@ -122,13 +124,14 @@ __attribute__((noinline)) void conv2d_nchw_core_generic( if (((_h + d0 * _wh - p0) >= 0) && ((_h + d0 * _wh - p0) < h) && ((_w + d1 * _ww - p1) >= 0) && - ((_w + d1 * _ww - p1 < w))) { + ((_w + d1 * _ww - p1) < w)) { int ioff = (_h + d0 * _wh - p0) * w + (_w + d1 * _ww - p1); int woff = _wh * ww + _ww; float lhs = in_plane[ioff] - in_zero_point; float rhs = weight_plane[woff] - - (quantized ? weight_zero_point[0] : 0); + (quantized ? 0 : 0); + /*(quantized ? weight_zero_point[0] : 0);*/ acc += lhs * rhs; } }