Skip to content

Commit fa7b621

Browse files
dskhudiafacebook-github-bot
authored andcommitted
Remove duplicate calculation of output shape (pytorch#26684)
Summary: Pull Request resolved: pytorch#26684 Output heights and widths are already calculated by conv_p. Remove the duplicate calculation. ghstack-source-id: 90633432 Test Plan: buck test mode/dev caffe2/test:quantized ``` Summary (total time 18.69s): PASS: 45 FAIL: 0 SKIP: 10 caffe2/test:quantized - test_qadd_scalar_relu (test_quantized.TestQuantizedOps) caffe2/test:quantized - test_equal (test_quantized.TestQuantizedOps) caffe2/test:quantized - test_qnnpack_add (test_quantized.TestQNNPackOps) caffe2/test:quantized - test_qconv_unpack (test_quantized.TestQNNPackOps) caffe2/test:quantized - test_qlinear_unpack (test_quantized.TestQNNPackOps) caffe2/test:quantized - test_compare_tensor_scalar (test_quantized.TestComparatorOps) caffe2/test:quantized - test_qconv_qnnpack (test_quantized.TestQNNPackOps) caffe2/test:quantized - test_qlinear_qnnpack (test_quantized.TestQNNPackOps) caffe2/test:quantized - test_qnnpack_relu (test_quantized.TestQNNPackOps) caffe2/test:quantized - test_qnnpack_maxpoolMore details at https://our.intern.facebook.com/intern/buck/build/3b394f1e-ab99-4e59-bdf5-2766f46e9869 2d (test_quantized.TestQNNPackOps) FATAL: 0 TIMEOUT: 0 OMIT: 0 ``` Differential Revision: D17538375 fbshipit-source-id: b4b60e93fdec4cc7bbf6aee7182381221dfac243
1 parent 128a65e commit fa7b621

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

aten/src/ATen/native/quantized/cpu/qconv.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ class QConv2dInt8 final : public c10::OperatorKernel {
194194
TORCH_CHECK(false, "[QConv2D] Unknown quantization scheme");
195195
}
196196

197-
// TODO: change convOutputShape to return NCHW sizes once perf is fixed
198-
auto outShape =
199-
convOutputShape(N, K, H, W, kernel, stride, padding, dilation);
197+
// TODO: change the following to NCHW sizes once perf is fixed
198+
SmallVector<int64_t, 4> outShape{
199+
N, conv_p.OUT_DIM[0], conv_p.OUT_DIM[1], K};
200200
TORCH_CHECK(
201201
std::all_of(
202202
outShape.begin(), outShape.end(), [](int64_t i) { return i > 0; }),

0 commit comments

Comments
 (0)