Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions backends/cadence/reference/operators/quantized_conv_out.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
Expand Down