diff --git a/csrc/cpu/jit/cpu/kernels/OpContext.cpp b/csrc/cpu/jit/cpu/kernels/OpContext.cpp index 22bcf3392..ead9a3660 100644 --- a/csrc/cpu/jit/cpu/kernels/OpContext.cpp +++ b/csrc/cpu/jit/cpu/kernels/OpContext.cpp @@ -374,7 +374,7 @@ c10::intrusive_ptr IpexWoqLinearOpContext::create_context( if (qtype == c10::kPerTensorAffine) { weight_scales_float[0] = weight.q_scale(); } else if (qtype == c10::kPerChannelAffine) { - weight_scales_float.resize(N, 0.0); + weight_scales_float.resize(N); for (const auto i : c10::irange(N)) { weight_scales_float[i] = weight.q_per_channel_scales()[i].item(); } @@ -393,7 +393,7 @@ c10::intrusive_ptr IpexWoqLinearOpContext::create_context( if (qtype == c10::kPerTensorAffine) { weight_zero_points_int32[0] = weight.q_zero_point(); } else if (qtype == c10::kPerChannelAffine) { - weight_zero_points_int32.resize(N, 0); + weight_zero_points_int32.resize(N); for (const auto i : c10::irange(N)) { weight_zero_points_int32[i] = weight.q_per_channel_zero_points()[i].item(); @@ -412,7 +412,7 @@ c10::intrusive_ptr IpexWoqLinearOpContext::create_context( if (qtype == c10::kPerTensorAffine) { weight_zero_points_float[0] = (float)weight.q_zero_point(); } else if (qtype == c10::kPerChannelAffine) { - weight_zero_points_float.resize(N, 0); + weight_zero_points_float.resize(N); for (const auto i : c10::irange(N)) { weight_zero_points_float[i] = (float)weight.q_per_channel_zero_points()[i].item(); @@ -440,7 +440,7 @@ c10::intrusive_ptr IpexWoqLinearOpContext::create_context( // extract scales from weight std::vector weight_scales_float(1, 0.0); if (qtype == c10::kPerChannelAffineFloatQParams) { - weight_scales_float.resize(N, 0.0); + weight_scales_float.resize(N); for (const auto i : c10::irange(N)) { weight_scales_float[i] = weight.q_per_channel_scales()[i].item(); } @@ -457,7 +457,7 @@ c10::intrusive_ptr IpexWoqLinearOpContext::create_context( // extract zero_points from weight std::vector weight_zero_points_float(1, 0); if (qtype == c10::kPerChannelAffineFloatQParams) { - weight_zero_points_float.resize(N, 0); + weight_zero_points_float.resize(N); for (const auto i : c10::irange(N)) { weight_zero_points_float[i] = weight.q_per_channel_zero_points()[i].item();