@@ -374,7 +374,7 @@ c10::intrusive_ptr<WoqLinearOpContext> IpexWoqLinearOpContext::create_context(
374
374
if (qtype == c10::kPerTensorAffine ) {
375
375
weight_scales_float[0 ] = weight.q_scale ();
376
376
} else if (qtype == c10::kPerChannelAffine ) {
377
- weight_scales_float.resize (N, 0.0 );
377
+ weight_scales_float.resize (N);
378
378
for (const auto i : c10::irange (N)) {
379
379
weight_scales_float[i] = weight.q_per_channel_scales ()[i].item <float >();
380
380
}
@@ -393,7 +393,7 @@ c10::intrusive_ptr<WoqLinearOpContext> IpexWoqLinearOpContext::create_context(
393
393
if (qtype == c10::kPerTensorAffine ) {
394
394
weight_zero_points_int32[0 ] = weight.q_zero_point ();
395
395
} else if (qtype == c10::kPerChannelAffine ) {
396
- weight_zero_points_int32.resize (N, 0 );
396
+ weight_zero_points_int32.resize (N);
397
397
for (const auto i : c10::irange (N)) {
398
398
weight_zero_points_int32[i] =
399
399
weight.q_per_channel_zero_points ()[i].item <int32_t >();
@@ -412,7 +412,7 @@ c10::intrusive_ptr<WoqLinearOpContext> IpexWoqLinearOpContext::create_context(
412
412
if (qtype == c10::kPerTensorAffine ) {
413
413
weight_zero_points_float[0 ] = (float )weight.q_zero_point ();
414
414
} else if (qtype == c10::kPerChannelAffine ) {
415
- weight_zero_points_float.resize (N, 0 );
415
+ weight_zero_points_float.resize (N);
416
416
for (const auto i : c10::irange (N)) {
417
417
weight_zero_points_float[i] =
418
418
(float )weight.q_per_channel_zero_points ()[i].item <int32_t >();
@@ -440,7 +440,7 @@ c10::intrusive_ptr<WoqLinearOpContext> IpexWoqLinearOpContext::create_context(
440
440
// extract scales from weight
441
441
std::vector<float > weight_scales_float (1 , 0.0 );
442
442
if (qtype == c10::kPerChannelAffineFloatQParams ) {
443
- weight_scales_float.resize (N, 0.0 );
443
+ weight_scales_float.resize (N);
444
444
for (const auto i : c10::irange (N)) {
445
445
weight_scales_float[i] = weight.q_per_channel_scales ()[i].item <float >();
446
446
}
@@ -457,7 +457,7 @@ c10::intrusive_ptr<WoqLinearOpContext> IpexWoqLinearOpContext::create_context(
457
457
// extract zero_points from weight
458
458
std::vector<float > weight_zero_points_float (1 , 0 );
459
459
if (qtype == c10::kPerChannelAffineFloatQParams ) {
460
- weight_zero_points_float.resize (N, 0 );
460
+ weight_zero_points_float.resize (N);
461
461
for (const auto i : c10::irange (N)) {
462
462
weight_zero_points_float[i] =
463
463
weight.q_per_channel_zero_points ()[i].item <float >();
0 commit comments