!6178 [VM][Quant]fix bug of convert to quantative network of parameter has_bias

Merge pull request !6178 from chenfei_mindspore/master
pull/6178/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit c9545b1b78

@ -187,7 +187,9 @@ class ConvertToQuantNetwork:
num_bits=self.weight_bits,
fake=True,
symmetric=self.weight_symmetric,
narrow_range=self.weight_range)
narrow_range=self.weight_range,
has_bias=conv_inner.has_bias,
bias_init=conv_inner.bias_init)
# change original network BatchNormal OP parameters to quant network
conv_inner.gamma = subcell.batchnorm.gamma
conv_inner.beta = subcell.batchnorm.beta
@ -212,7 +214,9 @@ class ConvertToQuantNetwork:
per_channel=self.weight_channel,
num_bits=self.weight_bits,
symmetric=self.weight_symmetric,
narrow_range=self.weight_range)
narrow_range=self.weight_range,
has_bias=conv_inner.has_bias,
bias_init=conv_inner.bias_init)
# change original network BatchNormal OP parameters to quant network
conv_inner.batchnorm.gamma = subcell.batchnorm.gamma
conv_inner.batchnorm.beta = subcell.batchnorm.beta

Loading…
Cancel
Save