use optimization in D14020675 (#16945)
authorJongsoo Park <jongsoo@fb.com>
Wed, 3 Apr 2019 14:55:02 +0000 (07:55 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 Apr 2019 15:05:10 +0000 (08:05 -0700)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16945

As title

Reviewed By: jianyuh

Differential Revision: D14020769

fbshipit-source-id: fc0f05fcc57bfe9b4aa0c5750060d7b2ba57dd7a

caffe2/quantization/server/conv_dnnlowp_op.cc

index d585af5..05c788e 100644 (file)
@@ -1224,7 +1224,9 @@ void ConvDNNLowPOp<T, ReluFused>::ConvNHWCCore_(
             out_qparams_.zero_point,
             in_qparams_[INPUT].zero_point,
             filter_zero_points_.data(),
-            row_offsets_.data() + tid * row_offset_size_per_thread,
+            filter_zero_points_[0]
+                ? row_offsets_.data() + tid * row_offset_size_per_thread
+                : nullptr,
             column_offsets_->data(),
             b_quantized_data_,
             conv_p.OC,
@@ -1234,7 +1236,9 @@ void ConvDNNLowPOp<T, ReluFused>::ConvNHWCCore_(
             conv_p,
             reinterpret_cast<const uint8_t*>(Xdata),
             in_qparams_[INPUT].zero_point,
-            row_offsets_.data() + tid * row_offset_size_per_thread,
+            filter_zero_points_[0]
+                ? row_offsets_.data() + tid * row_offset_size_per_thread
+                : nullptr,
             *Wq_gconv_packed_,
             Y_uint8_data,
             Y_int32->data(),