Merge pull request !3351 from fangzehua/fix_padding
This commit is contained in:
mindspore-ci-bot 2020-07-23 14:59:23 +08:00 committed by Gitee
commit 7f1af2cc5f
1 changed files with 1 additions and 2 deletions

View File

@ -1332,10 +1332,9 @@ class Conv2DBackpropInput(PrimitiveWithInfer):
validator.check_value_type('pad', pad, (int, tuple), self.name)
if isinstance(pad, int):
pad = (pad,) * 4
self.padding = pad
else:
validator.check_integer('pad size', len(pad), 4, Rel.EQ, self.name)
self.padding = pad
self.pad_mode = validator.check_string('pad_mode', pad_mode, ['valid', 'same', 'pad'], self.name)
if pad_mode != 'pad' and pad != (0, 0, 0, 0):
raise ValueError(f"For '{self.name}', padding must be zero when pad_mode is '{pad_mode}'.")