!10338 add typecheck for in_channels&out_channels of Conv2dBnFoldQuant

From: @yuchaojie
Reviewed-by: @liangchenghui,@linqingke
Signed-off-by: @liangchenghui
This commit is contained in:
mindspore-ci-bot 2020-12-22 19:16:06 +08:00 committed by Gitee
commit 597c032a31
1 changed files with 4 additions and 4 deletions

View File

@ -407,8 +407,8 @@ class Conv2dBnFoldQuantOneConv(Cell):
quant_dtype=QuantDtype.INT8):
"""Initialize Conv2dBnFoldQuant layer"""
super(Conv2dBnFoldQuantOneConv, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.in_channels = Validator.check_positive_int(in_channels)
self.out_channels = Validator.check_positive_int(out_channels)
self.kernel_size = twice(kernel_size)
self.stride = twice(stride)
self.pad_mode = pad_mode
@ -626,8 +626,8 @@ class Conv2dBnFoldQuant(Cell):
freeze_bn=100000):
"""Initialize Conv2dBnFoldQuant layer"""
super(Conv2dBnFoldQuant, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.in_channels = Validator.check_positive_int(in_channels)
self.out_channels = Validator.check_positive_int(out_channels)
self.kernel_size = twice(kernel_size)
self.stride = twice(stride)
self.pad_mode = pad_mode